aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2018-10-25 15:35:27 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2018-10-25 15:35:27 +0000
commit632df14c519e15124316a6451473fbc5a52daf51 (patch)
tree8cfb361eafe56eada4b8e29ee64eca21c2863b95 /test
parent4d3e4f1f05524792f9f7770ae5e4fbd527c0de31 (diff)
[OPENMP]Fix PR39422: variables are not firstprivatized in task context.
According to the OpenMP standard, In a task generating construct, if no default clause is present, a variable for which the data-sharing attribute is not determined by the rules above is firstprivatized. Compiler tries to implement this, but if the variable is not directly used in the task context, this variable may not be firstprivatized. Patch fixes this problem. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345277 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/OpenMP/parallel_sections_default_messages.cpp2
-rw-r--r--test/OpenMP/task_codegen.cpp1
2 files changed, 2 insertions, 1 deletions
diff --git a/test/OpenMP/parallel_sections_default_messages.cpp b/test/OpenMP/parallel_sections_default_messages.cpp
index a62b86ff34..b16e5f7369 100644
--- a/test/OpenMP/parallel_sections_default_messages.cpp
+++ b/test/OpenMP/parallel_sections_default_messages.cpp
@@ -34,7 +34,7 @@ int main(int argc, char **argv) {
{
#pragma omp parallel sections default(shared)
{
- ++argc;
+ ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
}
}
return 0;
diff --git a/test/OpenMP/task_codegen.cpp b/test/OpenMP/task_codegen.cpp
index 05767726f0..b034bb29c8 100644
--- a/test/OpenMP/task_codegen.cpp
+++ b/test/OpenMP/task_codegen.cpp
@@ -107,6 +107,7 @@ int main() {
// CHECK: call i32 @__kmpc_omp_task([[IDENT_T]]* @{{.+}}, i32 [[GTID]], i8* [[ORIG_TASK_PTR]])
#pragma omp task untied
{
+#pragma omp critical
a = 1;
}
// CHECK: [[ORIG_TASK_PTR:%.+]] = call i8* @__kmpc_omp_task_alloc([[IDENT_T]]* @{{.+}}, i32 [[GTID]], i32 0, i64 40, i64 1,