summaryrefslogtreecommitdiffstats
path: root/test/OpenMP
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
commit00ad5635bb0511b53b1052a1b8795d055cd179e1 (patch)
tree2084e379a79278558805e1314b076fe10b3d37cf /test/OpenMP
parenta2434be670ce23b82d55b382ad90aa2269f52c40 (diff)
[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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230621 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/OpenMP')
-rw-r--r--test/OpenMP/critical_codegen.cpp9
-rw-r--r--test/OpenMP/for_codegen.cpp8
-rw-r--r--test/OpenMP/master_codegen.cpp9
-rw-r--r--test/OpenMP/simd_codegen.cpp8
-rw-r--r--test/OpenMP/single_codegen.cpp9
5 files changed, 43 insertions, 0 deletions
diff --git a/test/OpenMP/critical_codegen.cpp b/test/OpenMP/critical_codegen.cpp
index dda532ca36..37a062d71a 100644
--- a/test/OpenMP/critical_codegen.cpp
+++ b/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/test/OpenMP/for_codegen.cpp b/test/OpenMP/for_codegen.cpp
index badc5bdeca..3193d84b6a 100644
--- a/test/OpenMP/for_codegen.cpp
+++ b/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/test/OpenMP/master_codegen.cpp b/test/OpenMP/master_codegen.cpp
index d354bae2d7..38eaa336be 100644
--- a/test/OpenMP/master_codegen.cpp
+++ b/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/test/OpenMP/simd_codegen.cpp b/test/OpenMP/simd_codegen.cpp
index b8073c2948..fac1427c30 100644
--- a/test/OpenMP/simd_codegen.cpp
+++ b/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/test/OpenMP/single_codegen.cpp b/test/OpenMP/single_codegen.cpp
index e67af0f508..b98da37591 100644
--- a/test/OpenMP/single_codegen.cpp
+++ b/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