diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2018-03-07 18:17:06 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2018-03-07 18:17:06 +0000 |
commit | ab4ea225fe60b9adf6dd3d757fa75e6c7ca8731d (patch) | |
tree | 732b8c55c7c31edd8e14d649a264fab12d80e9a0 /clang/test/OpenMP/for_codegen.cpp | |
parent | 2d19f9036e67bc1a9ff3811953906a6b42cbd8d6 (diff) | |
download | bcm5719-llvm-ab4ea225fe60b9adf6dd3d757fa75e6c7ca8731d.tar.gz bcm5719-llvm-ab4ea225fe60b9adf6dd3d757fa75e6c7ca8731d.zip |
[OPENMP] Fix lifetime of the loop counters.
We may emit incorrect lifetime info during codegen for loop counters in
OpenMP constructs because of automatic scope cleanup when we needed
temporarily locations for private loop counters.
llvm-svn: 326922
Diffstat (limited to 'clang/test/OpenMP/for_codegen.cpp')
-rw-r--r-- | clang/test/OpenMP/for_codegen.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/clang/test/OpenMP/for_codegen.cpp b/clang/test/OpenMP/for_codegen.cpp index 7c295a0b8fb..e26bbaaf479 100644 --- a/clang/test/OpenMP/for_codegen.cpp +++ b/clang/test/OpenMP/for_codegen.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s +// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope | FileCheck %s --check-prefix=CHECK --check-prefix=LIFETIME // 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 -debug-info-kind=line-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG @@ -25,8 +25,20 @@ // CHECK-LABEL: loop_with_counter_collapse void loop_with_counter_collapse() { + // LIFETIME: call void @llvm.lifetime.end + // LIFETIME: call void @llvm.lifetime.end // CHECK: call void @__kmpc_for_static_init_8(%ident_t* @ // CHECK: call void @__kmpc_for_static_fini(%ident_t* @ + // LIFETIME: call void @llvm.lifetime.end + // LIFETIME: call void @llvm.lifetime.end + // LIFETIME: call void @llvm.lifetime.end + // LIFETIME: call void @llvm.lifetime.end + // LIFETIME: call void @llvm.lifetime.end + // LIFETIME: call void @llvm.lifetime.end + // LIFETIME: call void @llvm.lifetime.end + // LIFETIME: call void @llvm.lifetime.end + // LIFETIME: call void @llvm.lifetime.end + // LIFETIME: call void @llvm.lifetime.end #pragma omp for collapse(2) for (int i = 0; i < 4; i++) { for (int j = i; j < 4; j++) { |