1 // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - -fsanitize=thread %s | FileCheck %s --check-prefixes=CHECK,OLD-PATH
2 // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - -O1 -fno-inline %s | FileCheck %s --check-prefixes=CHECK,OLD-PATH
3 // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - -O1 -fno-inline -relaxed-aliasing -fsanitize=thread %s | FileCheck %s --check-prefixes=CHECK,OLD-PATH
5 // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -new-struct-path-tbaa -o - -fsanitize=thread %s | FileCheck %s --check-prefixes=CHECK,NEW-PATH
6 // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -new-struct-path-tbaa -o - -O1 -fno-inline %s | FileCheck %s --check-prefixes=CHECK,NEW-PATH
7 // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -new-struct-path-tbaa -o - -O1 -fno-inline -relaxed-aliasing -fsanitize=thread %s | FileCheck %s --check-prefixes=CHECK,NEW-PATH
9 // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s --check-prefix=NOTBAA
10 // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - -O2 -fno-inline -relaxed-aliasing %s | FileCheck %s --check-prefix=NOTBAA
12 // Check that we generate TBAA for vtable pointer loads and stores.
13 // When -fsanitize=thread is used TBAA should be generated at all opt levels
14 // even if -relaxed-aliasing is present.
16 virtual int foo() const ;
24 void CallFoo(A
*a
, int (A::*fp
)() const) {
29 // CHECK-LABEL: @_Z7CallFoo
30 // CHECK: %{{.*}} = load ptr, {{.*}} !tbaa ![[NUM:[0-9]+]]
32 // CHECK: load ptr, {{.*}}, !tbaa ![[NUM]]
34 // CHECK-LABEL: @_ZN1AC2Ev
35 // CHECK: store ptr {{.*}}, !tbaa ![[NUM]]
37 // OLD-PATH: [[NUM]] = !{[[TYPE:!.*]], [[TYPE]], i64 0}
38 // OLD-PATH: [[TYPE]] = !{!"vtable pointer", !{{.*}}
39 // NEW-PATH: [[NUM]] = !{[[TYPE:!.*]], [[TYPE]], i64 0, i64 [[POINTER_SIZE:.*]]}
40 // NEW-PATH: [[TYPE]] = !{!{{.*}}, i64 [[POINTER_SIZE]], !"vtable pointer"}
41 // NOTBAA-NOT: = !{!"Simple C++ TBAA"}