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

19 lines
648 B
C

// REQUIRES: x86-registered-target
// This verifies that we correctly handle a -fms-secure-hotpatch-functions-file argument that points
// to a missing file.
//
// RUN: not %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-file=%S/this-file-is-intentionally-missing-do-not-create-it.txt /Fo%t.obj -- %s 2>&1 | FileCheck %s
// CHECK: failed to open hotpatch functions file
void this_might_have_side_effects();
int __declspec(noinline) this_gets_hotpatched() {
this_might_have_side_effects();
return 42;
}
int __declspec(noinline) this_does_not_get_hotpatched() {
return this_gets_hotpatched() + 100;
}