1 // RUN: %clang_cc1 -triple x86_64-unknown-linux -fvisibility=hidden -fsanitize=cfi-nvcall -emit-llvm -o - %s | FileCheck %s
2 // RUN: %clang_cc1 -triple x86_64-unknown-linux -fvisibility=hidden -fsanitize=cfi-nvcall,cfi-cast-strict -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-STRICT %s
18 // CHECK-STRICT-LABEL: @bg
19 extern "C" void bg(B
*b
) {
20 // CHECK: call i1 @llvm.type.test(ptr {{%[^ ]*}}, metadata !"_ZTS1B")
21 // CHECK-STRICT: call i1 @llvm.type.test(ptr {{%[^ ]*}}, metadata !"_ZTS1B")
26 // CHECK-STRICT-LABEL: @cg
27 extern "C" void cg(C
*c
) {
28 // http://clang.llvm.org/docs/ControlFlowIntegrity.html#strictness
29 // In this case C's layout is the same as its base class, so we allow
30 // c to be of type A in non-strict mode.
32 // CHECK: call i1 @llvm.type.test(ptr {{%[^ ]*}}, metadata !"_ZTS1A")
33 // CHECK-STRICT: call i1 @llvm.type.test(ptr {{%[^ ]*}}, metadata !"_ZTS1C")