diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-03-10 04:22:11 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-03-10 04:22:11 +0000 |
commit | 7ab2cc178fd68568146d21e320733885bde3687c (patch) | |
tree | ef5f0588ad173b79579d479241e3a4889e928e9d /clang/test/OpenMP/atomic_codegen.cpp | |
parent | 760bf9520ad1ec7a487ea1244c5c97ea235e4532 (diff) | |
download | bcm5719-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/atomic_codegen.cpp')
-rw-r--r-- | clang/test/OpenMP/atomic_codegen.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/clang/test/OpenMP/atomic_codegen.cpp b/clang/test/OpenMP/atomic_codegen.cpp new file mode 100644 index 00000000000..1ceb8638617 --- /dev/null +++ b/clang/test/OpenMP/atomic_codegen.cpp @@ -0,0 +1,30 @@ +// 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, |