1 // Copyright (c) Microsoft. All rights reserved.
2 // Licensed under the MIT license. See LICENSE file in the project root for
3 // full license information.
4 
5 #include <windows.h>
6 #include "seh.h"
7 
8 char test[] = "SEH0048.c";
9 int perfect;
10 
11 int main() {
12   ULONG Index1;
13   ULONG Index2 = 1;
14   LONG Counter;
15 
16   Counter = 0;
17   Index1 = 1;
18 
19   switch (Index2) {
20   case 0:
21     /* never gets here, Index2 is 2 */
22     Counter += 100;
23     break;
24   case 1:
25     try {
26       if ((Index1 & 0x1) == 1) {
27         /* set counter to 1 */
28         Counter += 1;
29       }
30     }
31     finally {
32       /* ste counter to 3 and rbeak out of switch */
33       Counter += 2;
34 #if defined(_MSC_VER) && !defined(__clang__)
35       break;
36 #endif
37     }
38     endtry
39 #ifndef _MSC_VER
40     break;
41 #endif
42     /* never gets here due to break */
43     Counter += 4;
44   }
45 
46   if (Counter != 3) {
47     printf("TEST 48 FAILED. Counter = %d\n\r", Counter);
48     return -1;
49   }
50 
51   return 0;
52 }
53