// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-unknown-linux -fvisibility hidden -std=c++11 -fsanitize=cfi-derived-cast -fsanitize-trap=cfi-derived-cast -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-DCAST %s
// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-unknown-linux -fvisibility hidden -std=c++11 -fsanitize=cfi-unrelated-cast -fsanitize-trap=cfi-unrelated-cast -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-UCAST %s
// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-unknown-linux -fvisibility hidden -std=c++11 -fsanitize=cfi-unrelated-cast,cfi-cast-strict -fsanitize-trap=cfi-unrelated-cast,cfi-cast-strict -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-UCAST-STRICT %s
// In this test the main thing we are searching for is something like
// 'metadata !"1B"' where "1B" is the mangled name of the class we are
// casting to (or maybe its base class in non-strict mode).
;
;
;
// CHECK-DCAST-LABEL: define hidden void @_Z3abpP1A
void
// CHECK-DCAST-LABEL: define hidden void @_Z3abrR1A
void
// CHECK-DCAST-LABEL: define hidden void @_Z4abrrO1A
void
// CHECK-UCAST-LABEL: define hidden void @_Z3vbpPv
void
// CHECK-UCAST-LABEL: define hidden void @_Z3vbrRc
void
// CHECK-UCAST-LABEL: define hidden void @_Z4vbrrOc
void
// CHECK-UCAST-LABEL: define hidden void @_Z3vcpPv
// CHECK-UCAST-STRICT-LABEL: define hidden void @_Z3vcpPv
void
// CHECK-UCAST-LABEL: define hidden void @_Z3bcpP1B
// CHECK-UCAST-STRICT-LABEL: define hidden void @_Z3bcpP1B
void
// CHECK-UCAST-LABEL: define hidden void @_Z8bcp_callP1B
// CHECK-UCAST-STRICT-LABEL: define hidden void @_Z8bcp_callP1B
void
// CHECK-UCAST-LABEL: define hidden noundef i32 @_Z6a_callP1A
// CHECK-UCAST-STRICT-LABEL: define hidden noundef i32 @_Z6a_callP1A
int