Debian Codegraph @

clang/test/CodeGen/X86/ms-secure-hotpatch-cpp.cpp

raw
1 // REQUIRES: x86-registered-target
2
3 // This verifies that hotpatch function attributes are correctly propagated when compiling directly to OBJ,
4 // and that name mangling works as expected.
5 //
6 // RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-list=?this_gets_hotpatched@@YAHXZ /Fo%t.obj -- %s
7 // RUN: llvm-readobj --codeview %t.obj | FileCheck %s
8
9 void this_might_have_side_effects();
10
11 int __declspec(noinline) this_gets_hotpatched() {
12 this_might_have_side_effects();
13 return 42;
14 }
15
16 // CHECK: Kind: S_HOTPATCHFUNC (0x1169)
17 // CHECK-NEXT: Function: this_gets_hotpatched
18 // CHECK-NEXT: Name: ?this_gets_hotpatched@@YAHXZ
19
20 extern "C" int __declspec(noinline) this_does_not_get_hotpatched() {
21 return this_gets_hotpatched() + 100;
22 }
23
24 // CHECK-NOT: S_HOTPATCHFUNC