diff --git a/flang/lib/Semantics/check-omp-structure.cpp b/flang/lib/Semantics/check-omp-structure.cpp index 5fbe8f8a577cfd..1af0d776ee7a9e 100644 --- a/flang/lib/Semantics/check-omp-structure.cpp +++ b/flang/lib/Semantics/check-omp-structure.cpp @@ -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; diff --git a/flang/test/Semantics/OpenMP/task-untied01.f90 b/flang/test/Semantics/OpenMP/task-untied01.f90 new file mode 100644 index 00000000000000..bbda50734e93a0 --- /dev/null +++ b/flang/test/Semantics/OpenMP/task-untied01.f90 @@ -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 diff --git a/mlir/test/Target/LLVMIR/openmp-llvm.mlir b/mlir/test/Target/LLVMIR/openmp-llvm.mlir index 8903bf283b5c75..772192ad8184b0 100644 --- a/mlir/test/Target/LLVMIR/openmp-llvm.mlir +++ b/mlir/test/Target/LLVMIR/openmp-llvm.mlir @@ -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 @@ -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} {} // ----- @@ -2907,8 +2907,8 @@ module attributes {omp.version = #omp.version} {} // 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} {} // ----- @@ -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 {