1 // REQUIRES: system-windows
3 // RUN: %clang_cl /Od /Z7 /Zi %s -o %t
4 // RUN: %dexter --fail-lt 1.0 -w --binary %t --debugger 'dbgeng' -- %s
6 // RUN: %clang_cl /O2 /Z7 /Zi %s -o %t
7 // RUN: %dexter --fail-lt 1.0 -w --binary %t \
8 // RUN: --debugger 'dbgeng' -- %s
10 // This code is structured to have an early exit with an epilogue in the middle
11 // of the function, which creates a gap between the beginning of the inlined
12 // code region and the end. Previously, this confused cdb.
14 volatile bool shutting_down_
= true;
15 volatile bool tearing_down_
= true;
17 void __attribute__((optnone
)) setCrashString(const char *) {}
18 void __attribute__((optnone
)) doTailCall() {}
19 extern "C" void __declspec(noreturn
) abort();
21 void __forceinline
inlineCrashFrame() {
22 if (shutting_down_
|| tearing_down_
) {
23 setCrashString("crashing");
24 // MSVC lays out calls to abort out of line, gets the layout we want.
25 abort(); // DexLabel('stop')
29 void __declspec(noinline
) callerOfInlineCrashFrame(bool is_keeping_alive
) {
36 int __attribute__((optnone
)) main() {
37 callerOfInlineCrashFrame(true);
41 DexExpectProgramState({'frames':[
42 {'function': 'inlineCrashFrame', 'location':{'lineno' : ref('stop')} },
43 {'function': 'callerOfInlineCrashFrame'},