Skip to content

Commit 99657dc

Browse files
committed
Slightly adapt new runnable/pragmainline.d for LDC
1 parent 65a7dfa commit 99657dc

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

tests/dmd/runnable/pragmainline.d

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,18 @@ auto testAlwaysInline()
4343
assert(var == 0);
4444
}
4545

46+
// LDC: inlining an *indirect* call (of the function pointer returned by `bar()`)
47+
// requires enabled optimizations
48+
version (LDC) version (D_Optimized) version = LDC_Optimized;
49+
4650
void main()
4751
{
4852
immutable baz = () => 1;
49-
assert(foo() == bar()());
53+
version (LDC_Optimized)
54+
assert(foo() == bar()());
5055
assert(foo() == baz());
51-
assert(bar()() == baz());
56+
version (LDC_Optimized)
57+
assert(bar()() == baz());
5258

5359
testAlwaysInline();
5460

0 commit comments

Comments
 (0)