Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Thirumalai-Shaktivel committed Dec 24, 2024
1 parent d77eae0 commit 1618ba4
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 7 deletions.
2 changes: 1 addition & 1 deletion flang/lib/Semantics/check-omp-structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class OmpDesignatorChecker {
if (name.symbol->test(Symbol::Flag::OmpThreadprivate)) {
// OpenMP 5.2: 5.2 threadprivate directive restriction
context_.Say(name.source,
"A THREADPRIVATE variable `%s` cannot appear in a UNTIED TASK region"_err_en_US,
"A THREADPRIVATE variable `%s` cannot appear in an UNTIED TASK region"_err_en_US,
name.source);
}
return true;
Expand Down
29 changes: 29 additions & 0 deletions flang/test/Semantics/OpenMP/task-untied01.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
! REQUIRES: openmp_runtime
! RUN: %python %S/../test_errors.py %s %flang %openmp_flags
!
! OpenMP 5.2: 5.2 threadprivate directive restriction

subroutine task_untied01()
integer, save :: var_01, var_02(2)
real :: var_03
common /c/ var_03

!$omp threadprivate(var_01, var_02)
!$omp threadprivate(/c/)

!$omp task untied
!ERROR: A THREADPRIVATE variable `var_01` cannot appear in an UNTIED TASK region
var_01 = 10
!ERROR: A THREADPRIVATE variable `var_02` cannot appear in an UNTIED TASK region
!ERROR: A THREADPRIVATE variable `var_01` cannot appear in an UNTIED TASK region
var_02(1) = sum([var_01, 20])
!$omp end task

!$omp task untied
!ERROR: A THREADPRIVATE variable `var_02` cannot appear in an UNTIED TASK region
!ERROR: A THREADPRIVATE variable `var_02` cannot appear in an UNTIED TASK region
var_02(2) = product(var_02)
!ERROR: A THREADPRIVATE variable `var_03` cannot appear in an UNTIED TASK region
var_03 = 3.14
!$omp end task
end subroutine task_untied01
12 changes: 6 additions & 6 deletions mlir/test/Target/LLVMIR/openmp-llvm.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ llvm.func @_QPomp_atomic_update_complex() {
//CHECK: %[[VAL_8:.*]] = fadd contract float %[[VAL_6]], 1.000000e+00
//CHECK: %[[VAL_9:.*]] = insertvalue { float, float } undef, float %[[VAL_7]], 0
//CHECK: %[[VAL_10:.*]] = insertvalue { float, float } %[[VAL_9]], float %[[VAL_8]], 1
//CHECK: store { float, float } %[[VAL_10]], ptr %[[X_NEW_VAL]], align 4
//CHECK: store { float, float } %[[VAL_10]], ptr %[[X_NEW_VAL]], align 4
//CHECK: %[[VAL_11:.*]] = call i1 @__atomic_compare_exchange(i64 8, ptr %[[ORIG_VAL]], ptr %[[ATOMIC_TEMP_LOAD]], ptr %[[X_NEW_VAL]], i32 2, i32 2)
//CHECK: %[[VAL_12:.*]] = load { float, float }, ptr %[[ATOMIC_TEMP_LOAD]], align 4
//CHECK: br i1 %[[VAL_11]], label %.atomic.exit, label %.atomic.cont
Expand Down Expand Up @@ -2861,8 +2861,8 @@ llvm.func @omp_opaque_pointers(%arg0 : !llvm.ptr, %arg1: !llvm.ptr, %expr: i32)
// CHECK: @__omp_rtl_assume_threads_oversubscription = weak_odr hidden constant i32 1
// CHECK: @__omp_rtl_assume_no_thread_state = weak_odr hidden constant i32 1
// CHECK: @__omp_rtl_assume_no_nested_parallelism = weak_odr hidden constant i32 1
module attributes {omp.flags = #omp.flags<debug_kind = 1, assume_teams_oversubscription = true,
assume_threads_oversubscription = true, assume_no_thread_state = true,
module attributes {omp.flags = #omp.flags<debug_kind = 1, assume_teams_oversubscription = true,
assume_threads_oversubscription = true, assume_no_thread_state = true,
assume_no_nested_parallelism = true>} {}
// -----

Expand Down Expand Up @@ -2907,8 +2907,8 @@ module attributes {omp.version = #omp.version<version = 51>} {}
// CHECK: @__omp_rtl_assume_threads_oversubscription = weak_odr hidden constant i32 0
// CHECK: @__omp_rtl_assume_no_thread_state = weak_odr hidden constant i32 0
// CHECK: @__omp_rtl_assume_no_nested_parallelism = weak_odr hidden constant i32 0
module attributes {omp.flags = #omp.flags<debug_kind = 0, assume_teams_oversubscription = false,
assume_threads_oversubscription = false, assume_no_thread_state = false,
module attributes {omp.flags = #omp.flags<debug_kind = 0, assume_teams_oversubscription = false,
assume_threads_oversubscription = false, assume_no_thread_state = false,
assume_no_nested_parallelism = false>} {}

// -----
Expand Down Expand Up @@ -3021,7 +3021,7 @@ module attributes {omp.is_target_device = true} {
// -----

llvm.func @omp_task_untied() {
// The third argument is 0: which signifies the united task
// The third argument is 0: which signifies the untied task
// CHECK: {{.*}} = call ptr @__kmpc_omp_task_alloc(ptr @1, i32 %{{.*}}, i32 0,
// CHECK-SAME: i64 40, i64 0, ptr @{{.*}})
omp.task untied {
Expand Down

0 comments on commit 1618ba4

Please sign in to comment.