[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / cross-project-tests / debuginfo-tests / dexter-tests / inline-line-gap.cpp
blob75e3b639ecc86c02d33a241c478dc4651f5c1d4a
1 // REQUIRES: system-windows
2 //
3 // RUN: %dexter --fail-lt 1.0 -w --builder 'clang-cl_vs2015' \
4 // RUN: --debugger 'dbgeng' --cflags '/Od /Z7 /Zi' \
5 // RUN: --ldflags '/Od /Z7 /Zi' -- %s
6 //
7 // RUN: %dexter --fail-lt 1.0 -w --builder 'clang-cl_vs2015' \
8 // RUN: --debugger 'dbgeng' --cflags '/O2 /Z7 /Zi' \
9 // RUN: --ldflags '/O2 /Z7 /Zi' -- %s
11 // This code is structured to have an early exit with an epilogue in the middle
12 // of the function, which creates a gap between the beginning of the inlined
13 // code region and the end. Previously, this confused cdb.
15 volatile bool shutting_down_ = true;
16 volatile bool tearing_down_ = true;
18 void __attribute__((optnone)) setCrashString(const char *) {}
19 void __attribute__((optnone)) doTailCall() {}
20 extern "C" void __declspec(noreturn) abort();
22 void __forceinline inlineCrashFrame() {
23 if (shutting_down_ || tearing_down_) {
24 setCrashString("crashing");
25 // MSVC lays out calls to abort out of line, gets the layout we want.
26 abort(); // DexLabel('stop')
30 void __declspec(noinline) callerOfInlineCrashFrame(bool is_keeping_alive) {
31 if (is_keeping_alive)
32 inlineCrashFrame();
33 else
34 doTailCall();
37 int __attribute__((optnone)) main() {
38 callerOfInlineCrashFrame(true);
42 DexExpectProgramState({'frames':[
43 {'function': 'inlineCrashFrame', 'location':{'lineno' : ref('stop')} },
44 {'function': 'callerOfInlineCrashFrame'},
45 {'function': 'main'}
46 ]})