summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/parallel_for_codegen.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2018-02-16 19:16:54 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2018-02-16 19:16:54 +0000
commit9a75738b2b785097a018e2df54925faead6cc6d0 (patch)
tree5d7416a1edbd4e7beb9de4575de279de5f8b2c4f /clang/test/OpenMP/parallel_for_codegen.cpp
parentba92059ca9ffce8b9eb0c496638dec62a2975ae3 (diff)
downloadbcm5719-llvm-9a75738b2b785097a018e2df54925faead6cc6d0.tar.gz
bcm5719-llvm-9a75738b2b785097a018e2df54925faead6cc6d0.zip
[OPENMP] Fix PR35873: Fix data-sharing attributes for const variables.
Compiler erroneously returned wrong data-sharing attributes for the constant variables if they have explictly specified attributes. llvm-svn: 325373
Diffstat (limited to 'clang/test/OpenMP/parallel_for_codegen.cpp')
-rw-r--r--clang/test/OpenMP/parallel_for_codegen.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/test/OpenMP/parallel_for_codegen.cpp b/clang/test/OpenMP/parallel_for_codegen.cpp
index d2f3647221c..e6199f00eab 100644
--- a/clang/test/OpenMP/parallel_for_codegen.cpp
+++ b/clang/test/OpenMP/parallel_for_codegen.cpp
@@ -354,9 +354,9 @@ int foo() {return 0;};
// TERM_DEBUG-LABEL: parallel_for
// CLEANUP: parallel_for
-void parallel_for(float *a, int n) {
+void parallel_for(float *a, const int n) {
float arr[n];
-#pragma omp parallel for schedule(static, 5) private(arr)
+#pragma omp parallel for schedule(static, 5) private(arr) default(none) firstprivate(n) shared(a)
// TERM_DEBUG-NOT: __kmpc_global_thread_num
// TERM_DEBUG: call void @__kmpc_for_static_init_4u({{.+}}), !dbg [[DBG_LOC_START:![0-9]+]]
// TERM_DEBUG: invoke i32 {{.*}}foo{{.*}}()
@@ -370,7 +370,7 @@ void parallel_for(float *a, int n) {
// CLEANUP: call void @__kmpc_for_static_init_4u({{.+}})
// CLEANUP: call void @__kmpc_for_static_fini({{.+}})
for (unsigned i = 131071; i <= 2147483647; i += 127)
- a[i] += foo() + arr[i];
+ a[i] += foo() + arr[i] + n;
}
// Check source line corresponds to "#pragma omp parallel for schedule(static, 5)" above:
// TERM_DEBUG-DAG: [[DBG_LOC_START]] = !DILocation(line: [[@LINE-4]],
OpenPOWER on IntegriCloud