summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2015-02-26 10:27:34 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2015-02-26 10:27:34 +0000
commit8cbe0a6b626eb7e158f339c20f4af74996d9d4ac (patch)
tree0bb66795e605d91d469f53a0a6076163f3c9b3e3 /clang/test
parenta42de763ac54f79ce2f9abc8330e107275b2afc9 (diff)
downloadbcm5719-llvm-8cbe0a6b626eb7e158f339c20f4af74996d9d4ac.tar.gz
bcm5719-llvm-8cbe0a6b626eb7e158f339c20f4af74996d9d4ac.zip
[OPENMP] Fixed codegen for directives without function outlining.
Fixed crash on codegen for directives like 'omp for', 'omp single' etc. inside of the 'omp parallel', 'omp task' etc. regions. llvm-svn: 230621
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/OpenMP/critical_codegen.cpp9
-rw-r--r--clang/test/OpenMP/for_codegen.cpp8
-rw-r--r--clang/test/OpenMP/master_codegen.cpp9
-rw-r--r--clang/test/OpenMP/simd_codegen.cpp8
-rw-r--r--clang/test/OpenMP/single_codegen.cpp9
5 files changed, 43 insertions, 0 deletions
diff --git a/clang/test/OpenMP/critical_codegen.cpp b/clang/test/OpenMP/critical_codegen.cpp
index dda532ca369..37a062d71ab 100644
--- a/clang/test/OpenMP/critical_codegen.cpp
+++ b/clang/test/OpenMP/critical_codegen.cpp
@@ -35,4 +35,13 @@ int main() {
return a;
}
+// CHECK-LABEL: parallel_critical
+void parallel_critical(float *a) {
+#pragma omp parallel
+#pragma omp critical
+ // CHECK-NOT: __kmpc_global_thread_num
+ for (unsigned i = 131071; i <= 2147483647; i += 127)
+ a[i] += i;
+}
+
#endif
diff --git a/clang/test/OpenMP/for_codegen.cpp b/clang/test/OpenMP/for_codegen.cpp
index badc5bdeca0..3193d84b6a1 100644
--- a/clang/test/OpenMP/for_codegen.cpp
+++ b/clang/test/OpenMP/for_codegen.cpp
@@ -146,5 +146,13 @@ void static_chunked(float *a, float *b, float *c, float *d) {
// CHECK: ret void
}
+void parallel_for(float *a) {
+#pragma omp parallel
+#pragma omp for schedule(static, 5)
+ // CHECK-NOT: __kmpc_global_thread_num
+ for (unsigned i = 131071; i <= 2147483647; i += 127)
+ a[i] += i;
+}
+
#endif // HEADER
diff --git a/clang/test/OpenMP/master_codegen.cpp b/clang/test/OpenMP/master_codegen.cpp
index d354bae2d7e..38eaa336be5 100644
--- a/clang/test/OpenMP/master_codegen.cpp
+++ b/clang/test/OpenMP/master_codegen.cpp
@@ -43,4 +43,13 @@ int main() {
return a;
}
+// CHECK-LABEL: parallel_master
+void parallel_master(float *a) {
+#pragma omp parallel
+#pragma omp master
+ // CHECK-NOT: __kmpc_global_thread_num
+ for (unsigned i = 131071; i <= 2147483647; i += 127)
+ a[i] += i;
+}
+
#endif
diff --git a/clang/test/OpenMP/simd_codegen.cpp b/clang/test/OpenMP/simd_codegen.cpp
index b8073c2948e..fac1427c30f 100644
--- a/clang/test/OpenMP/simd_codegen.cpp
+++ b/clang/test/OpenMP/simd_codegen.cpp
@@ -403,5 +403,13 @@ void widened(float *a, float *b, float *c, float *d) {
// CHECK: ret void
}
+void parallel_simd(float *a) {
+#pragma omp parallel
+#pragma omp simd
+ // CHECK-NOT: __kmpc_global_thread_num
+ for (unsigned i = 131071; i <= 2147483647; i += 127)
+ a[i] += i;
+}
+
#endif // HEADER
diff --git a/clang/test/OpenMP/single_codegen.cpp b/clang/test/OpenMP/single_codegen.cpp
index e67af0f5089..b98da375914 100644
--- a/clang/test/OpenMP/single_codegen.cpp
+++ b/clang/test/OpenMP/single_codegen.cpp
@@ -43,4 +43,13 @@ int main() {
return a;
}
+// CHECK-LABEL: parallel_single
+void parallel_single(float *a) {
+#pragma omp parallel
+#pragma omp single
+ // CHECK-NOT: __kmpc_global_thread_num
+ for (unsigned i = 131071; i <= 2147483647; i += 127)
+ a[i] += i;
+}
+
#endif
OpenPOWER on IntegriCloud