MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / warn12809.d
blob8daf44ca0f5a0cf31fa5bc5c639d8983eee13900
1 // REQUIRED_ARGS: -o- -w
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 */
11 //void test_unrachable1()
12 //{
13 // try assert(0);
14 // finally
15 // {
16 // int x = 1; // unreachable
17 // }
18 //}
20 void test_unrachable2()
22 try assert(0);
23 finally {}
25 int x = 1; // unreachable
28 void test_unrachable3()
30 try {}
31 finally assert(0);
33 int x = 1; // unreachable
36 /********************************************/
39 TEST_OUTPUT:
40 ---
41 fail_compilation/warn12809.d(108): Warning: statement is not reachable
42 fail_compilation/warn12809.d(115): Warning: statement is not reachable
43 fail_compilation/warn12809.d(122): Warning: statement is not reachable
44 Error: warnings are treated as errors
45 Use -wi if you wish to treat warnings only as informational.
46 ---
49 #line 100
51 alias noreturn = typeof(*null);
53 noreturn foo();
55 void test1(ref int i)
57 foo();
58 i = 3;
61 void test2()
63 try foo();
64 finally { }
65 int x = 1;
68 void test3()
70 try { }
71 finally foo();
72 int x = 1;