summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/single_codegen.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2015-03-10 04:22:11 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2015-03-10 04:22:11 +0000
commit7ab2cc178fd68568146d21e320733885bde3687c (patch)
treeef5f0588ad173b79579d479241e3a4889e928e9d /clang/test/OpenMP/single_codegen.cpp
parent760bf9520ad1ec7a487ea1244c5c97ea235e4532 (diff)
downloadbcm5719-llvm-7ab2cc178fd68568146d21e320733885bde3687c.tar.gz
bcm5719-llvm-7ab2cc178fd68568146d21e320733885bde3687c.zip
[OPENMP] Improved code for generating debug info + generation of all OpenMP regions in termination scope
Patch adds proper generation of debug info for all OpenMP regions. Also, all OpenMP regions are generated in a termination scope, because standard does not allow to throw exceptions out of structured blocks, associated with the OpenMP regions Differential Revision: http://reviews.llvm.org/D7935 llvm-svn: 231752
Diffstat (limited to 'clang/test/OpenMP/single_codegen.cpp')
-rw-r--r--clang/test/OpenMP/single_codegen.cpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/clang/test/OpenMP/single_codegen.cpp b/clang/test/OpenMP/single_codegen.cpp
index b98da375914..2da22d44d27 100644
--- a/clang/test/OpenMP/single_codegen.cpp
+++ b/clang/test/OpenMP/single_codegen.cpp
@@ -1,6 +1,7 @@
// 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
@@ -13,6 +14,7 @@
void foo() {}
// CHECK-LABEL: @main
+// TERM_DEBUG-LABEL: @main
int main() {
// CHECK: [[A_ADDR:%.+]] = alloca i8
char a;
@@ -32,8 +34,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: call void [[FOO]]()
-// CHECK-NEXT: call void @__kmpc_end_single([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]])
+// CHECK-NEXT: invoke void [[FOO]]()
+// CHECK: call void @__kmpc_end_single([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]])
// CHECK-NEXT: br label {{%?}}[[EXIT]]
// CHECK: [[EXIT]]
#pragma omp single
@@ -43,13 +45,23 @@ int main() {
return a;
}
-// CHECK-LABEL: parallel_single
-void parallel_single(float *a) {
+// CHECK-LABEL: parallel_single
+// TERM_DEBUG-LABEL: parallel_single
+void parallel_single() {
#pragma omp parallel
#pragma omp single
- // CHECK-NOT: __kmpc_global_thread_num
- for (unsigned i = 131071; i <= 2147483647; i += 127)
- a[i] += i;
+ // 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();
}
+// TERM_DEBUG-DAG: [[DBG_LOC_START]] = !MDLocation(line: 52,
+// TERM_DEBUG-DAG: [[DBG_LOC_END]] = !MDLocation(line: 52,
#endif
OpenPOWER on IntegriCloud