24 lines · c
1// REQUIRES: x86-registered-target2 3// This verifies that hotpatch function attributes are correctly propagated when compiling directly to OBJ.4//5// RUN: echo this_gets_hotpatched > %t.patch-functions.txt6// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-file=%t.patch-functions.txt /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 19int __declspec(noinline) this_does_not_get_hotpatched() {20 return this_gets_hotpatched() + 100;21}22 23// CHECK-NOT: S_HOTPATCHFUNC24