From 9f4dbff6669c8037f3b036bcf580d14f1a4f12a5 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 24 Nov 2014 09:15:30 +0000 Subject: Vendor import of clang RELEASE_350/final tag r216957 (effectively, 3.5.0 release): https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_350/final@216957 --- test/CodeGen/tbaa-for-vptr.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'test/CodeGen/tbaa-for-vptr.cpp') diff --git a/test/CodeGen/tbaa-for-vptr.cpp b/test/CodeGen/tbaa-for-vptr.cpp index 7ba058bffe66..ded574ea9376 100644 --- a/test/CodeGen/tbaa-for-vptr.cpp +++ b/test/CodeGen/tbaa-for-vptr.cpp @@ -1,12 +1,12 @@ -// RUN: %clang_cc1 -emit-llvm -o - -fsanitize=thread %s | FileCheck %s -// RUN: %clang_cc1 -emit-llvm -o - -O1 %s | FileCheck %s -// RUN: %clang_cc1 -emit-llvm -o - -O1 -relaxed-aliasing -fsanitize=thread %s | FileCheck %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - -fsanitize=thread %s | FileCheck %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - -O1 %s | FileCheck %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - -O1 -relaxed-aliasing -fsanitize=thread %s | FileCheck %s // -// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s --check-prefix=NOTBAA -// RUN: %clang_cc1 -emit-llvm -o - -O2 -relaxed-aliasing %s | FileCheck %s --check-prefix=NOTBAA +// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s --check-prefix=NOTBAA +// RUN: %clang_cc1 -triple %itanium_abi_triple -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 +// When -fsanitize=thread is used TBAA should be generated at all opt levels // even if -relaxed-aliasing is present. struct A { virtual int foo() const ; @@ -17,12 +17,19 @@ void CreateA() { new A; } -void CallFoo(A *a) { +void CallFoo(A *a, int (A::*fp)() const) { a->foo(); + (a->*fp)(); } +// CHECK-LABEL: @_Z7CallFoo // CHECK: %{{.*}} = load {{.*}} !tbaa ![[NUM:[0-9]+]] +// CHECK: br i1 +// CHECK: load {{.*}}, !tbaa ![[NUM]] +// +// CHECK-LABEL: @_ZN1AC2Ev // CHECK: store {{.*}} !tbaa ![[NUM]] +// // CHECK: [[NUM]] = metadata !{metadata [[TYPE:!.*]], metadata [[TYPE]], i64 0} // CHECK: [[TYPE]] = metadata !{metadata !"vtable pointer", metadata !{{.*}} // NOTBAA-NOT: = metadata !{metadata !"Simple C/C++ TBAA"} -- cgit v1.3