| 1 |
// REQUIRES: x86-registered-target |
| 2 |
|
| 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.txt |
| 6 |
// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-file=%t.patch-functions.txt /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 |
|
| 19 |
int __declspec(noinline) this_does_not_get_hotpatched() { |
| 20 |
return this_gets_hotpatched() + 100; |
| 21 |
} |
| 22 |
|
| 23 |
// CHECK-NOT: S_HOTPATCHFUNC |