]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/warn12809.d
Add D front-end, libphobos library, and D2 testsuite.
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / warn12809.d
1 // REQUIRED_ARGS: -o- -w
2
3 /*
4 TEST_OUTPUT:
5 ---
6 fail_compilation/warn12809.d(25): Warning: statement is not reachable
7 fail_compilation/warn12809.d(33): Warning: statement is not reachable
8 ---
9 */
10
11 //void test_unrachable1()
12 //{
13 // try assert(0);
14 // finally
15 // {
16 // int x = 1; // unreachable
17 // }
18 //}
19
20 void test_unrachable2()
21 {
22 try assert(0);
23 finally {}
24
25 int x = 1; // unreachable
26 }
27
28 void test_unrachable3()
29 {
30 try {}
31 finally assert(0);
32
33 int x = 1; // unreachable
34 }