[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Sema / warn-unreachable-ms.c
blobf1e08a68cee19665045e472b75aa94d254d30b63
1 // RUN: %clang_cc1 %s -triple=i686-pc-win32 -fsyntax-only -verify -fms-extensions -Wunreachable-code
3 void f(void);
5 void g1(void) {
6 __try {
7 f();
8 __leave;
9 f(); // expected-warning{{will never be executed}}
10 } __except(1) {
11 f();
14 // Completely empty.
15 __try {
16 } __except(1) {
19 __try {
20 f();
21 return;
22 } __except(1) { // Filter expression should not be marked as unreachable.
23 // Empty __except body.
27 void g2(void) {
28 __try {
29 // Nested __try.
30 __try {
31 f();
32 __leave;
33 f(); // expected-warning{{will never be executed}}
34 } __except(2) {
36 f();
37 __leave;
38 f(); // expected-warning{{will never be executed}}
39 } __except(1) {
40 f();
44 void g3(void) {
45 __try {
46 __try {
47 f();
48 } __except (1) {
49 __leave; // should exit outer try
51 __leave;
52 f(); // expected-warning{{never be executed}}
53 } __except (1) {