llvm-project/clang/test/CodeGen/X86/ms-secure-hotpatch-cpp.cpp
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

25 lines
807 B
C++

// REQUIRES: x86-registered-target
// This verifies that hotpatch function attributes are correctly propagated when compiling directly to OBJ,
// and that name mangling works as expected.
//
// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-list=?this_gets_hotpatched@@YAHXZ /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
// CHECK-NEXT: Name: ?this_gets_hotpatched@@YAHXZ
extern "C" int __declspec(noinline) this_does_not_get_hotpatched() {
return this_gets_hotpatched() + 100;
}
// CHECK-NOT: S_HOTPATCHFUNC