]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/fail3753.d
Add D front-end, libphobos library, and D2 testsuite.
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail3753.d
1 /*
2 ---
3 Error: cannot mix core.std.stdlib.alloca() and exception handling in _Dmain()
4 ---
5 */
6
7 import core.stdc.stdlib : alloca;
8 import core.stdc.stdio;
9
10 struct TheStruct
11 {
12 ~this()
13 {
14 printf("dtor()\n");
15 }
16 }
17
18 void bar()
19 {
20 printf("bar()\n");
21 }
22
23 void main()
24 {
25 auto s = TheStruct();
26 bar();
27 auto a = alloca(16);
28 printf("test()\n");
29 version (DigitalMars)
30 {
31 version (Win32) static assert(0);
32 version (linux)
33 {
34 static assert(0);
35 }
36 version (FreeBSD)
37 {
38 static assert(0);
39 }
40 version (OSX)
41 {
42 static assert(0);
43 }
44 }
45 else
46 static assert(0);
47 }