MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / runnable_cxx / test19179.d
blob6bdccfd18aa360e3408b23da9bee13640adf3b8e
1 // EXTRA_CPP_SOURCES: cpp19179.cpp
3 // https://issues.dlang.org/show_bug.cgi?id=19179
5 import core.stdc.stdio;
7 extern(C++) struct SmallStruct { int x = 10, y = 20; }
9 extern (C++)
10 SmallStruct test_small(SmallStruct s)
12 printf("%d %d\n", s.x, s.y); // prints: invalid memory
13 assert(s.x == 10);
14 assert(s.y == 20);
15 return s;
18 extern (C++)
19 void test_small_noret(SmallStruct s)
21 printf("%d %d\n", s.x, s.y); // prints: 10 20
22 assert(s.x == 10);
23 assert(s.y == 20);
26 extern (C++) void cppmain();
28 int main()
30 cppmain();
31 return 0;