diff options
Diffstat (limited to 'test/CodeGen/tbaa-for-vptr.cpp')
-rw-r--r-- | test/CodeGen/tbaa-for-vptr.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/CodeGen/tbaa-for-vptr.cpp b/test/CodeGen/tbaa-for-vptr.cpp index 5ce6bf3..b9a68fe 100644 --- a/test/CodeGen/tbaa-for-vptr.cpp +++ b/test/CodeGen/tbaa-for-vptr.cpp @@ -1,5 +1,13 @@ +// RUN: %clang_cc1 -emit-llvm -o - -O0 -fthread-sanitizer %s | FileCheck %s // RUN: %clang_cc1 -emit-llvm -o - -O1 %s | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -o - -O1 -relaxed-aliasing -fthread-sanitizer %s | FileCheck %s +// +// RUN: %clang_cc1 -emit-llvm -o - -O0 %s | FileCheck %s --check-prefix=NOTBAA +// RUN: %clang_cc1 -emit-llvm -o - -O2 -relaxed-aliasing %s | FileCheck %s --check-prefix=NOTBAA +// // Check that we generate TBAA for vtable pointer loads and stores. +// When -fthread-sanitizer is used TBAA should be generated at all opt levels +// even if -relaxed-aliasing is present. struct A { virtual int foo() const ; virtual ~A(); @@ -15,5 +23,5 @@ void CallFoo(A *a) { // CHECK: %{{.*}} = load {{.*}} !tbaa !0 // CHECK: store {{.*}} !tbaa !0 -// CHECK: !0 = metadata !{metadata !"vtable pointer", metadata !1} -// CHECK: !1 = metadata !{metadata !"Simple C/C++ TBAA"} +// CHECK: = metadata !{metadata !"vtable pointer", metadata !{{.*}}} +// NOTBAA-NOT: = metadata !{metadata !"Simple C/C++ TBAA"} |