summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/OpenMP')
-rw-r--r--clang/test/OpenMP/atomic_codegen.cpp30
-rw-r--r--clang/test/OpenMP/critical_codegen.cpp27
-rw-r--r--clang/test/OpenMP/for_codegen.cpp24
-rw-r--r--clang/test/OpenMP/master_codegen.cpp26
-rw-r--r--clang/test/OpenMP/parallel_codegen.cpp5
-rw-r--r--clang/test/OpenMP/simd_codegen.cpp25
-rw-r--r--clang/test/OpenMP/single_codegen.cpp26
7 files changed, 33 insertions, 130 deletions
diff --git a/clang/test/OpenMP/atomic_codegen.cpp b/clang/test/OpenMP/atomic_codegen.cpp
deleted file mode 100644
index 1ceb8638617..00000000000
--- a/clang/test/OpenMP/atomic_codegen.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp=libiomp5 -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
-// expected-no-diagnostics
-
-int a;
-int &foo() { return a; }
-
-// TERM_DEBUG-LABEL: parallel_atomic
-void parallel_atomic() {
-#pragma omp parallel
- {
-#pragma omp atomic read
- // TERM_DEBUG-NOT: __kmpc_global_thread_num
- // TERM_DEBUG: invoke {{.*}}foo{{.*}}()
- // TERM_DEBUG: unwind label %[[TERM_LPAD:.+]],
- // TERM_DEBUG: load atomic i32, i32* @{{.+}} monotonic, {{.*}}!dbg [[READ_LOC:![0-9]+]]
- foo() = a;
-#pragma omp atomic write
- // TERM_DEBUG-NOT: __kmpc_global_thread_num
- // TERM_DEBUG: invoke {{.*}}foo{{.*}}()
- // TERM_DEBUG: unwind label %[[TERM_LPAD:.+]],
- // TERM_DEBUG-NOT: __kmpc_global_thread_num
- // TERM_DEBUG: store atomic i32 {{%.+}}, i32* @{{.+}} monotonic, {{.*}}!dbg [[WRITE_LOC:![0-9]+]]
- // TERM_DEBUG: [[TERM_LPAD]]:
- // TERM_DEBUG: call void @__clang_call_terminate
- // TERM_DEBUG: unreachable
- a = foo();
- }
-}
-// TERM_DEBUG-DAG: [[READ_LOC]] = !MDLocation(line: 11,
-// TERM_DEBUG-DAG: [[WRITE_LOC]] = !MDLocation(line: 17,
diff --git a/clang/test/OpenMP/critical_codegen.cpp b/clang/test/OpenMP/critical_codegen.cpp
index 6384612c8e6..37a062d71ab 100644
--- a/clang/test/OpenMP/critical_codegen.cpp
+++ b/clang/test/OpenMP/critical_codegen.cpp
@@ -1,7 +1,6 @@
// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
-// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp=libiomp5 -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
// expected-no-diagnostics
#ifndef HEADER
@@ -16,7 +15,6 @@
void foo() {}
// CHECK-LABEL: @main
-// TERM_DEBUG-LABEL: @main
int main() {
// CHECK: [[A_ADDR:%.+]] = alloca i8
char a;
@@ -28,8 +26,8 @@ int main() {
#pragma omp critical
a = 2;
// CHECK: call void @__kmpc_critical([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]], [8 x i32]* [[THE_NAME_LOCK]])
-// CHECK-NEXT: invoke void [[FOO]]()
-// CHECK: call void @__kmpc_end_critical([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]], [8 x i32]* [[THE_NAME_LOCK]])
+// CHECK-NEXT: call void [[FOO]]()
+// CHECK-NEXT: call void @__kmpc_end_critical([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]], [8 x i32]* [[THE_NAME_LOCK]])
#pragma omp critical(the_name)
foo();
// CHECK-NOT: call void @__kmpc_critical
@@ -37,22 +35,13 @@ int main() {
return a;
}
-// CHECK-LABEL: parallel_critical
-// TERM_DEBUG-LABEL: parallel_critical
-void parallel_critical() {
+// CHECK-LABEL: parallel_critical
+void parallel_critical(float *a) {
#pragma omp parallel
#pragma omp critical
- // TERM_DEBUG-NOT: __kmpc_global_thread_num
- // TERM_DEBUG: call void @__kmpc_critical({{.+}}), !dbg [[DBG_LOC_START:![0-9]+]]
- // TERM_DEBUG: invoke void {{.*}}foo{{.*}}()
- // TERM_DEBUG: unwind label %[[TERM_LPAD:.+]],
- // TERM_DEBUG-NOT: __kmpc_global_thread_num
- // TERM_DEBUG: call void @__kmpc_end_critical({{.+}}), !dbg [[DBG_LOC_END:![0-9]+]]
- // TERM_DEBUG: [[TERM_LPAD]]:
- // TERM_DEBUG: call void @__clang_call_terminate
- // TERM_DEBUG: unreachable
- foo();
+ // CHECK-NOT: __kmpc_global_thread_num
+ for (unsigned i = 131071; i <= 2147483647; i += 127)
+ a[i] += i;
}
-// TERM_DEBUG-DAG: [[DBG_LOC_START]] = !MDLocation(line: 44,
-// TERM_DEBUG-DAG: [[DBG_LOC_END]] = !MDLocation(line: 44,
+
#endif
diff --git a/clang/test/OpenMP/for_codegen.cpp b/clang/test/OpenMP/for_codegen.cpp
index 2822513372d..78d8c84b3ee 100644
--- a/clang/test/OpenMP/for_codegen.cpp
+++ b/clang/test/OpenMP/for_codegen.cpp
@@ -1,7 +1,6 @@
// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
-// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp=libiomp5 -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
+// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -g -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
//
// expected-no-diagnostics
#ifndef HEADER
@@ -147,28 +146,13 @@ void static_chunked(float *a, float *b, float *c, float *d) {
// CHECK: ret void
}
-// TERM_DEBUG-LABEL: foo
-int foo() {return 0;};
-
-// TERM_DEBUG-LABEL: parallel_for
void parallel_for(float *a) {
#pragma omp parallel
#pragma omp for schedule(static, 5)
- // 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{{.*}}()
- // TERM_DEBUG: unwind label %[[TERM_LPAD:.+]],
- // TERM_DEBUG-NOT: __kmpc_global_thread_num
- // TERM_DEBUG: call void @__kmpc_for_static_fini({{.+}}), !dbg [[DBG_LOC_END:![0-9]+]]
- // TERM_DEBUG: call {{.+}} @__kmpc_cancel_barrier({{.+}}), !dbg [[DBG_LOC_CANCEL:![0-9]+]]
- // TERM_DEBUG: [[TERM_LPAD]]:
- // TERM_DEBUG: call void @__clang_call_terminate
- // TERM_DEBUG: unreachable
+ // CHECK-NOT: __kmpc_global_thread_num
for (unsigned i = 131071; i <= 2147483647; i += 127)
- a[i] += foo();
+ a[i] += i;
}
-// TERM_DEBUG-DAG: [[DBG_LOC_START]] = !MDLocation(line: 156,
-// TERM_DEBUG-DAG: [[DBG_LOC_END]] = !MDLocation(line: 156,
-// TERM_DEBUG-DAG: [[DBG_LOC_CANCEL]] = !MDLocation(line: 156,
+
#endif // HEADER
diff --git a/clang/test/OpenMP/master_codegen.cpp b/clang/test/OpenMP/master_codegen.cpp
index 2a58f93a13e..38eaa336be5 100644
--- a/clang/test/OpenMP/master_codegen.cpp
+++ b/clang/test/OpenMP/master_codegen.cpp
@@ -1,7 +1,6 @@
// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
-// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp=libiomp5 -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
// expected-no-diagnostics
#ifndef HEADER
@@ -14,7 +13,6 @@
void foo() {}
// CHECK-LABEL: @main
-// TERM_DEBUG-LABEL: @main
int main() {
// CHECK: [[A_ADDR:%.+]] = alloca i8
char a;
@@ -34,8 +32,8 @@ int main() {
// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
// CHECK: [[THEN]]
-// CHECK-NEXT: invoke void [[FOO]]()
-// CHECK: call void @__kmpc_end_master([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]])
+// CHECK-NEXT: call void [[FOO]]()
+// CHECK-NEXT: call void @__kmpc_end_master([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]])
// CHECK-NEXT: br label {{%?}}[[EXIT]]
// CHECK: [[EXIT]]
#pragma omp master
@@ -45,23 +43,13 @@ int main() {
return a;
}
-// CHECK-LABEL: parallel_master
-// TERM_DEBUG-LABEL: parallel_master
-void parallel_master() {
+// CHECK-LABEL: parallel_master
+void parallel_master(float *a) {
#pragma omp parallel
#pragma omp master
- // TERM_DEBUG-NOT: __kmpc_global_thread_num
- // TERM_DEBUG: call i32 @__kmpc_master({{.+}}), !dbg [[DBG_LOC_START:![0-9]+]]
- // TERM_DEBUG: invoke void {{.*}}foo{{.*}}()
- // TERM_DEBUG: unwind label %[[TERM_LPAD:.+]],
- // TERM_DEBUG-NOT: __kmpc_global_thread_num
- // TERM_DEBUG: call void @__kmpc_end_master({{.+}}), !dbg [[DBG_LOC_END:![0-9]+]]
- // TERM_DEBUG: [[TERM_LPAD]]:
- // TERM_DEBUG: call void @__clang_call_terminate
- // TERM_DEBUG: unreachable
- foo();
+ // CHECK-NOT: __kmpc_global_thread_num
+ for (unsigned i = 131071; i <= 2147483647; i += 127)
+ a[i] += i;
}
-// TERM_DEBUG-DAG: [[DBG_LOC_START]] = !MDLocation(line: 52,
-// TERM_DEBUG-DAG: [[DBG_LOC_END]] = !MDLocation(line: 52,
#endif
diff --git a/clang/test/OpenMP/parallel_codegen.cpp b/clang/test/OpenMP/parallel_codegen.cpp
index 386dcfaaad2..14450c2961b 100644
--- a/clang/test/OpenMP/parallel_codegen.cpp
+++ b/clang/test/OpenMP/parallel_codegen.cpp
@@ -62,7 +62,6 @@ int main (int argc, char **argv) {
// CHECK-DEBUG-NEXT: }
// CHECK-LABEL: define internal void @.omp_outlined.(i32* %.global_tid., i32* %.bound_tid., %struct.anon* %__context)
-// CHECK: #[[FN_ATTRS:[0-9]+]]
// CHECK: [[CONTEXT_ADDR:%.+]] = alloca %struct.anon*
// CHECK: store %struct.anon* %__context, %struct.anon** [[CONTEXT_ADDR]]
// CHECK: [[CONTEXT_PTR:%.+]] = load %struct.anon*, %struct.anon** [[CONTEXT_ADDR]]
@@ -75,7 +74,6 @@ int main (int argc, char **argv) {
// CHECK-NEXT: unreachable
// CHECK-NEXT: }
// CHECK-DEBUG-LABEL: define internal void @.omp_outlined.(i32* %.global_tid., i32* %.bound_tid., %struct.anon* %__context)
-// CHECK-DEBUG: #[[FN_ATTRS:[0-9]+]]
// CHECK-DEBUG: [[CONTEXT_ADDR:%.+]] = alloca %struct.anon*
// CHECK-DEBUG: store %struct.anon* %__context, %struct.anon** [[CONTEXT_ADDR]]
// CHECK-DEBUG: [[CONTEXT_PTR:%.+]] = load %struct.anon*, %struct.anon** [[CONTEXT_ADDR]]
@@ -144,7 +142,4 @@ int main (int argc, char **argv) {
// CHECK: define linkonce_odr void [[FOO1]](i8** %argc)
// CHECK-DEBUG: define linkonce_odr void [[FOO1]](i8** %argc)
-// CHECK: attributes #[[FN_ATTRS]] = {{.+}} nounwind
-// CHECK-DEBUG: attributes #[[FN_ATTRS]] = {{.+}} nounwind
-
#endif
diff --git a/clang/test/OpenMP/simd_codegen.cpp b/clang/test/OpenMP/simd_codegen.cpp
index 5a866942f8e..db92e0e4d69 100644
--- a/clang/test/OpenMP/simd_codegen.cpp
+++ b/clang/test/OpenMP/simd_codegen.cpp
@@ -1,7 +1,6 @@
// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -g -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
-// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp=libiomp5 -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
//
// expected-no-diagnostics
#ifndef HEADER
@@ -262,8 +261,8 @@ void iter_simple(IterDouble ia, IterDouble ib, IterDouble ic) {
//
// CHECK: store i32 0, i32* [[IT_OMP_IV:%[^,]+]]
// Calculate number of iterations before the loop body.
-// CHECK: [[DIFF1:%.+]] = invoke {{.*}}i32 @{{.*}}IterDouble{{.*}}
-// CHECK: [[DIFF2:%.+]] = sub nsw i32 [[DIFF1]], 1
+// CHECK: [[DIFF1:%.+]] = call {{.*}}i32 @{{.*}}IterDouble{{.*}}
+// CHECK-NEXT: [[DIFF2:%.+]] = sub nsw i32 [[DIFF1]], 1
// CHECK-NEXT: [[DIFF3:%.+]] = add nsw i32 [[DIFF2]], 1
// CHECK-NEXT: [[DIFF4:%.+]] = sdiv i32 [[DIFF3]], 1
// CHECK-NEXT: [[DIFF5:%.+]] = sub nsw i32 [[DIFF4]], 1
@@ -280,12 +279,12 @@ void iter_simple(IterDouble ia, IterDouble ib, IterDouble ic) {
// Start of body: calculate i from index:
// CHECK: [[IV1:%.+]] = load i32, i32* [[IT_OMP_IV]]{{.+}}!llvm.mem.parallel_loop_access ![[ITER_LOOP_ID]]
// Call of operator+ (i, IV).
-// CHECK: {{%.+}} = invoke {{.+}} @{{.*}}IterDouble{{.*}}
+// CHECK: {{%.+}} = call {{.+}} @{{.*}}IterDouble{{.*}}!llvm.mem.parallel_loop_access ![[ITER_LOOP_ID]]
// ... loop body ...
*i = *ic * 0.5;
// Float multiply and save result.
// CHECK: [[MULR:%.+]] = fmul double {{%.+}}, 5.000000e-01
-// CHECK-NEXT: invoke {{.+}} @{{.*}}IterDouble{{.*}}
+// CHECK-NEXT: call {{.+}} @{{.*}}IterDouble{{.*}}
// CHECK: store double [[MULR:%.+]], double* [[RESULT_ADDR:%.+]], !llvm.mem.parallel_loop_access ![[ITER_LOOP_ID]]
++ic;
//
@@ -404,23 +403,13 @@ void widened(float *a, float *b, float *c, float *d) {
// CHECK: ret void
}
-// TERM_DEBUG-LABEL: bar
-int bar() {return 0;};
-
-// TERM_DEBUG-LABEL: parallel_simd
void parallel_simd(float *a) {
#pragma omp parallel
#pragma omp simd
- // TERM_DEBUG-NOT: __kmpc_global_thread_num
- // TERM_DEBUG: invoke i32 {{.*}}bar{{.*}}()
- // TERM_DEBUG: unwind label %[[TERM_LPAD:.+]],
- // TERM_DEBUG-NOT: __kmpc_global_thread_num
- // TERM_DEBUG: [[TERM_LPAD]]:
- // TERM_DEBUG: call void @__clang_call_terminate
- // TERM_DEBUG: unreachable
+ // CHECK-NOT: __kmpc_global_thread_num
for (unsigned i = 131071; i <= 2147483647; i += 127)
- a[i] += bar();
+ a[i] += i;
}
-// TERM_DEBUG: !{{[0-9]+}} = !MDLocation(line: 413,
+
#endif // HEADER
diff --git a/clang/test/OpenMP/single_codegen.cpp b/clang/test/OpenMP/single_codegen.cpp
index 2da22d44d27..b98da375914 100644
--- a/clang/test/OpenMP/single_codegen.cpp
+++ b/clang/test/OpenMP/single_codegen.cpp
@@ -1,7 +1,6 @@
// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
-// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp=libiomp5 -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
// expected-no-diagnostics
#ifndef HEADER
@@ -14,7 +13,6 @@
void foo() {}
// CHECK-LABEL: @main
-// TERM_DEBUG-LABEL: @main
int main() {
// CHECK: [[A_ADDR:%.+]] = alloca i8
char a;
@@ -34,8 +32,8 @@ int main() {
// CHECK-NEXT: [[IS_SINGLE:%.+]] = icmp ne i32 [[RES]], 0
// CHECK-NEXT: br i1 [[IS_SINGLE]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
// CHECK: [[THEN]]
-// CHECK-NEXT: invoke void [[FOO]]()
-// CHECK: call void @__kmpc_end_single([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]])
+// CHECK-NEXT: call void [[FOO]]()
+// CHECK-NEXT: call void @__kmpc_end_single([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]])
// CHECK-NEXT: br label {{%?}}[[EXIT]]
// CHECK: [[EXIT]]
#pragma omp single
@@ -45,23 +43,13 @@ int main() {
return a;
}
-// CHECK-LABEL: parallel_single
-// TERM_DEBUG-LABEL: parallel_single
-void parallel_single() {
+// CHECK-LABEL: parallel_single
+void parallel_single(float *a) {
#pragma omp parallel
#pragma omp single
- // TERM_DEBUG-NOT: __kmpc_global_thread_num
- // TERM_DEBUG: call i32 @__kmpc_single({{.+}}), !dbg [[DBG_LOC_START:![0-9]+]]
- // TERM_DEBUG: invoke void {{.*}}foo{{.*}}()
- // TERM_DEBUG: unwind label %[[TERM_LPAD:.+]],
- // TERM_DEBUG-NOT: __kmpc_global_thread_num
- // TERM_DEBUG: call void @__kmpc_end_single({{.+}}), !dbg [[DBG_LOC_END:![0-9]+]]
- // TERM_DEBUG: [[TERM_LPAD]]:
- // TERM_DEBUG: call void @__clang_call_terminate
- // TERM_DEBUG: unreachable
- foo();
+ // CHECK-NOT: __kmpc_global_thread_num
+ for (unsigned i = 131071; i <= 2147483647; i += 127)
+ a[i] += i;
}
-// TERM_DEBUG-DAG: [[DBG_LOC_START]] = !MDLocation(line: 52,
-// TERM_DEBUG-DAG: [[DBG_LOC_END]] = !MDLocation(line: 52,
#endif
OpenPOWER on IntegriCloud