diff options
Diffstat (limited to 'test/OpenMP/for_codegen.cpp')
-rw-r--r-- | test/OpenMP/for_codegen.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/test/OpenMP/for_codegen.cpp b/test/OpenMP/for_codegen.cpp index 9db1570..98761f5 100644 --- a/test/OpenMP/for_codegen.cpp +++ b/test/OpenMP/for_codegen.cpp @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s // RUN: %clang_cc1 -fopenmp -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 -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG +// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -debug-info-kind=line-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG // // expected-no-diagnostics // REQUIRES: x86-registered-target @@ -357,7 +357,7 @@ void parallel_for(float *a) { // 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: call {{.+}} @__kmpc_barrier({{.+}}), !dbg [[DBG_LOC_CANCEL:![0-9]+]] // TERM_DEBUG: [[TERM_LPAD]] // TERM_DEBUG: call void @__clang_call_terminate // TERM_DEBUG: unreachable @@ -404,6 +404,25 @@ void for_with_global_lcv() { k = i; k = j; } + char &cnt = i; +#pragma omp for + for (cnt = 0; cnt < 2; ++cnt) + k = cnt; +} + +// CHECK-LABEL: for_with_references +void for_with_references() { +// CHECK: [[I:%.+]] = alloca i8, +// CHECK: [[CNT:%.+]] = alloca i8*, +// CHECK: [[CNT_PRIV:%.+]] = alloca i8, +// CHECK: call void @__kmpc_for_static_init_4( +// CHECK-NOT: load i8, i8* [[CNT]], +// CHECK: call void @__kmpc_for_static_fini( + char i = 0; + char &cnt = i; +#pragma omp for + for (cnt = 0; cnt < 2; ++cnt) + k = cnt; } struct Bool { |