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

27 lines
652 B
C++

// REQUIRES: x86-registered-target
// Global constant data such as exception handler tables should not be redirected by Windows Secure Hot-Patching
//
// RUN: %clang_cl -c --target=x86_64-windows-msvc /EHsc -O2 -fms-secure-hotpatch-functions-list=this_gets_hotpatched /Fo%t.obj /clang:-S /clang:-o- -- %s 2>& 1 | FileCheck %s
class Foo {
public:
int x;
};
void this_might_throw();
extern "C" int this_gets_hotpatched(int k) {
int ret;
try {
this_might_throw();
ret = 1;
} catch (Foo& f) {
ret = 2;
}
return ret;
}
// We expect that RTTI data is not redirected.
// CHECK-NOT: "__ref_??_R0?AVFoo@@@8"