brintos

brintos / llvm-project-archived public Read only

0
0
Text · 963 B · 8045e7b Raw
34 lines · cpp
1// RUN: %clang_cc1 -triple arm64e-apple-ios15 -fsanitize=vptr -O0 -emit-llvm -o - %s | FileCheck %s2// RUN: %clang_cc1 -triple arm64e-apple-ios15 -fsanitize=vptr -O2 -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s3 4// RUN: %clang_cc1 -triple aarch64-linux-gnu  -fsanitize=vptr -O0 -emit-llvm -o - %s | FileCheck %s5// RUN: %clang_cc1 -triple aarch64-linux-gnu  -fsanitize=vptr -O2 -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s6 7struct S {8  S() {}9  ~S() {}10  virtual int v() { return 0; }11  int a;12};13 14struct T : public S {15  virtual int v();16};17 18// CHECK-LABEL: foo119int foo1(void* Buffer) {20  T *p = reinterpret_cast<T*>(Buffer);21  return p->v();22}23// CHECK-NOT: call {{.*}} @llvm.ptrauth.auth{{.*}}24// CHECK-NOT: call {{.*}} @llvm.ptrauth.strip{{.*}}25 26// CHECK-LABEL: foo227int foo2(S* s) {28  T *p = dynamic_cast<T*>(s);29  return p->v();30}31 32// CHECK-NOT: call {{.*}} @llvm.ptrauth.auth{{.*}}33// CHECK-NOT: call {{.*}} @llvm.ptrauth.strip{{.*}}34