25 lines · cpp
1// REQUIRES: x86-registered-target2 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 -- %s7// RUN: llvm-readobj --codeview %t.obj | FileCheck %s8 9void this_might_have_side_effects();10 11int __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_hotpatched18// CHECK-NEXT: Name: ?this_gets_hotpatched@@YAHXZ19 20extern "C" int __declspec(noinline) this_does_not_get_hotpatched() {21 return this_gets_hotpatched() + 100;22}23 24// CHECK-NOT: S_HOTPATCHFUNC25