1 // RUN: %clang_cc1 %s -triple=i686-pc-win32 -fsyntax-only -verify -fms-extensions -Wunreachable-code
2 
3 void f();
4 
g1()5 void g1() {
6   __try {
7     f();
8     __leave;
9     f();  // expected-warning{{will never be executed}}
10   } __except(1) {
11     f();
12   }
13 
14   // Completely empty.
15   __try {
16   } __except(1) {
17   }
18 
19   __try {
20     f();
21     return;
22   } __except(1) {  // Filter expression should not be marked as unreachable.
23     // Empty __except body.
24   }
25 }
26 
g2()27 void g2() {
28   __try {
29     // Nested __try.
30     __try {
31       f();
32       __leave;
33       f(); // expected-warning{{will never be executed}}
34     } __except(2) {
35     }
36     f();
37     __leave;
38     f(); // expected-warning{{will never be executed}}
39   } __except(1) {
40     f();
41   }
42 }
43 
g3()44 void g3() {
45   __try {
46     __try {
47       f();
48     } __except (1) {
49       __leave; // should exit outer try
50     }
51     __leave;
52     f(); // expected-warning{{never be executed}}
53   } __except (1) {
54   }
55 }
56