llvm-project/clang/test/CodeGen/X86/ms-secure-hotpatch.c
sivadeilra 7aeb1a1fd8
Fix Solaris buildbot (#145737)
#145565 broke the Solaris buildbot, due to a subtlety in how
command-lines are parsed, which is different between Windows and
non-Windows platforms. The fix is to use `--` to force passing the rest
of args without interpretation. This is similar to existing tests for
`%clang_cl`, such as
`clang/test/CodeGen/debug-info-codeview-buildinfo.c`.

Currently, CI jobs for PRs do not detect this problem. Fixing that is
tracked in issue #145713.
2025-06-25 12:08:37 -07:00

24 lines
754 B
C

// REQUIRES: x86-registered-target
// This verifies that hotpatch function attributes are correctly propagated when compiling directly to OBJ.
//
// RUN: echo this_gets_hotpatched > %t.patch-functions.txt
// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-file=%t.patch-functions.txt /Fo%t.obj -- %s
// RUN: llvm-readobj --codeview %t.obj | FileCheck %s
void this_might_have_side_effects();
int __declspec(noinline) this_gets_hotpatched() {
this_might_have_side_effects();
return 42;
}
// CHECK: Kind: S_HOTPATCHFUNC (0x1169)
// CHECK-NEXT: Function: this_gets_hotpatched
int __declspec(noinline) this_does_not_get_hotpatched() {
return this_gets_hotpatched() + 100;
}
// CHECK-NOT: S_HOTPATCHFUNC