Skip to content

Commit 3352fb9

Browse files
committed
druntime: Fix backtrace tests with -O in 'exceptions' integration test
1 parent 9e37ab0 commit 3352fb9

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

runtime/druntime/test/exceptions/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ $(ROOT)/static_dtor.done: private negate=!
106106
$(ROOT)/future_message.done: stderr_exp="exception I have a custom message. exception exception "
107107
$(ROOT)/catch_in_finally.done: stderr_exp="success."
108108
$(ROOT)/rt_trap_exceptions.done: stderr_exp="object.Exception@src/rt_trap_exceptions.d(12): this will abort"
109+
ifneq ($(BUILD)-$(IN_LDC),release-1) # disable 2nd expression for LDC in BUILD=release mode
109110
$(ROOT)/rt_trap_exceptions.done: stderr_exp2="src/rt_trap_exceptions.d:8 main"
111+
endif
110112
$(ROOT)/assert_fail.done: stderr_exp="success."
111113
$(ROOT)/cpp_demangle.done: stderr_exp="thrower(int)"
112114
$(ROOT)/message_with_null.done: stderr_exp=" world"

runtime/druntime/test/exceptions/src/cpp_demangle.d

+7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ extern(C) char* __cxa_demangle (const char* mangled_name,
66
int* status) nothrow pure @trusted;
77

88
extern (C++) void thrower(int a) {
9+
version (LDC) pragma(inline, false);
910
throw new Exception("C++ ex");
1011
}
1112
void caller() {
@@ -17,3 +18,9 @@ void main()
1718
caller();
1819
__cxa_demangle(null, null, null, null); // make sure __cxa_demangle is linked
1920
}
21+
22+
version (LDC) version (D_Optimized)
23+
{
24+
// really make sure libstdc++ is linked
25+
shared bla = &__cxa_demangle;
26+
}

runtime/druntime/test/exceptions/src/line_trace.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ void main()
1313
}
1414

1515
void f1()
16-
{
16+
{ version (LDC) pragma(inline, false);
1717
throw new Exception("exception");
1818
}

runtime/druntime/test/exceptions/src/long_backtrace_trunc.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ struct FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
77
struct GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG {
88
struct HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH {
99
T tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt(int x) {
10-
throw new Exception("test");
10+
version (LDC) pragma(inline, false); throw new Exception("test");
1111
}
1212
}
1313
}

0 commit comments

Comments
 (0)