1 // RUN: %clang_cc1 -triple x86_64-unknown-linux -fsanitize=cfi-icall -fsanitize-trap=cfi-icall -emit-llvm -o - %s | FileCheck --check-prefix=ITANIUM %s
2 // RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -fsanitize=cfi-icall -fsanitize-trap=cfi-icall -emit-llvm -o - %s | FileCheck --check-prefix=MS %s
3
4 // Tests that we assign appropriate identifiers to unprototyped functions.
5
f()6 void f() {
7 }
8
9 void xf();
10
g(int b)11 void g(int b) {
12 void (*fp)() = b ? f : xf;
13 // ITANIUM: call i1 @llvm.bitset.test(i8* {{.*}}, metadata !"_ZTSFvE")
14 fp();
15 }
16
17 // ITANIUM-DAG: !{!"_ZTSFvE", void ()* @f, i64 0}
18 // ITANIUM-DAG: !{!"_ZTSFvE", void (...)* @xf, i64 0}
19 // MS-DAG: !{!"?6AX@Z", void ()* @f, i64 0}
20 // MS-DAG: !{!"?6AX@Z", void (...)* @xf, i64 0}
21