Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / cfi-icall.cpp
blob8493a0b877e9adde1033fac92bceb393acd1db77
1 // RUN: %clang_cc1 -triple x86_64-unknown-linux -fsanitize=cfi-icall -fsanitize-trap=cfi-icall -emit-llvm -o - %s | FileCheck --check-prefix=CHECK --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=CHECK --check-prefix=MS %s
4 // Tests that we assign unnamed metadata nodes to functions whose types have
5 // internal linkage.
7 namespace {
9 struct S {};
11 void f(S s) {
16 void g() {
17 struct S s;
18 void (*fp)(S) = f;
19 // CHECK: call i1 @llvm.type.test(ptr {{.*}}, metadata [[VOIDS1:![0-9]+]])
20 fp(s);
23 // ITANIUM: define internal void @_ZN12_GLOBAL__N_11fENS_1SE({{.*}} !type [[TS1:![0-9]+]] !type [[TS2:![0-9]+]]
24 // MS: define internal void @"?f@?A0x{{[^@]*}}@@YAXUS@?A0x{{[^@]*}}@@@Z"({{.*}} !type [[TS1:![0-9]+]] !type [[TS2:![0-9]+]]
26 // CHECK: [[VOIDS1]] = distinct !{}
27 // CHECK: [[TS1]] = !{i64 0, [[VOIDS1]]}
28 // CHECK: [[TS2]] = !{i64 0, [[VOIDS2:![0-9]+]]}
29 // CHECK: [[VOIDS2]] = distinct !{}