30 lines · cpp
1// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -emit-llvm -std=c++11 %s -o - | FileCheck %s2// RUN: %clang_cc1 -triple aarch64-linux-gnu -fptrauth-calls -emit-llvm -std=c++11 %s -o - | FileCheck %s3 4namespace Test1 {5 struct B1 {6 virtual void* foo1() {7 return 0;8 }9 };10 struct Pad1 {11 virtual ~Pad1() {}12 };13 struct Proxy1 : Pad1, B1 {14 virtual ~Proxy1() {}15 };16 struct D : virtual Proxy1 {17 virtual ~D() {}18 virtual void* foo1();19 };20 void* D::foo1() {21 return (void*)this;22 }23}24 25// CHECK-LABEL: define linkonce_odr void @_ZTv0_n24_N5Test11DD0Ev(ptr noundef %this)26// CHECK: %[[This:.*]] = load ptr27// CHECK: %[[SignedVTable:.*]] = load ptr, ptr %[[This]], align 828// CHECK: %[[SignedVTableAsInt:.*]] = ptrtoint ptr %[[SignedVTable]] to i6429// CHECK: %[[VTable:.*]] = call i64 @llvm.ptrauth.auth(i64 %[[SignedVTableAsInt]], i32 2, i64 0)30