summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/for_codegen.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2017-12-04 21:30:42 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2017-12-04 21:30:42 +0000
commitc2e88a8a6b03b7cdbeef807b60f030ba10abcfa8 (patch)
tree4657c5ccbbffd8d145243e8ce72597a70898bb22 /clang/test/OpenMP/for_codegen.cpp
parent68ba772cc0fcc2997f0e7827dd01f42f85161b7d (diff)
downloadbcm5719-llvm-c2e88a8a6b03b7cdbeef807b60f030ba10abcfa8.tar.gz
bcm5719-llvm-c2e88a8a6b03b7cdbeef807b60f030ba10abcfa8.zip
[OPENMP] Fix PR35486: crash when collapsing loops with dependent iteration spaces.
Though it is incorrect from point of view of OpenMP standard to have dependent iteration space in OpenMP loops, compiler should not crash. Patch fixes this problem. llvm-svn: 319700
Diffstat (limited to 'clang/test/OpenMP/for_codegen.cpp')
-rw-r--r--clang/test/OpenMP/for_codegen.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/test/OpenMP/for_codegen.cpp b/clang/test/OpenMP/for_codegen.cpp
index 9ea167fb1fd..6d719f4486a 100644
--- a/clang/test/OpenMP/for_codegen.cpp
+++ b/clang/test/OpenMP/for_codegen.cpp
@@ -16,6 +16,16 @@
// CHECK-DAG: [[J:@.+]] = global i8 2,
// CHECK-DAG: [[K:@.+]] = global i8 3,
+// CHECK-LABEL: loop_with_counter_collapse
+void loop_with_counter_collapse() {
+ // CHECK: call void @__kmpc_for_static_init_8(%ident_t* @
+ // CHECK: call void @__kmpc_for_static_fini(%ident_t* @
+ #pragma omp for collapse(2)
+ for (int i = 0; i < 4; i++) {
+ for (int j = i; j < 4; j++) {
+ }
+ }
+}
// CHECK-LABEL: define {{.*void}} @{{.*}}without_schedule_clause{{.*}}(float* {{.+}}, float* {{.+}}, float* {{.+}}, float* {{.+}})
void without_schedule_clause(float *a, float *b, float *c, float *d) {
// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[IDENT_T_TY]]* [[DEFAULT_LOC:[@%].+]])
@@ -330,8 +340,8 @@ void runtime(float *a, float *b, float *c, float *d) {
// CHECK-LABEL: test_precond
void test_precond() {
// CHECK: [[A_ADDR:%.+]] = alloca i8,
- // CHECK: [[CAP:%.+]] = alloca i8,
// CHECK: [[I_ADDR:%.+]] = alloca i8,
+ // CHECK: [[CAP:%.+]] = alloca i8,
char a = 0;
// CHECK: store i8 0,
// CHECK: store i32
OpenPOWER on IntegriCloud