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[] = "SEH0046.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     Counter += 100;
22     break;
23   case 1:
24     try {
25       try {
26         if ((Index1 & 0x1) == 1) {
27           /* break out of switchy stmt. */
28           break;
29         } else {
30           Counter += 1;
31         }
32       }
33       except(1) {
34         /* no exception occurs, never gets here */
35         Counter += 10;
36       }
37       endtry
38       /* "break" keeps you from getting here */
39       Counter += 2;
40     }
41     except(1) {
42       /* no exception occurs, never gets here */
43       Counter += 20;
44     }
45     endtry
46     /* "break" keeps you from getting here */
47     Counter += 3;
48   }
49 
50   if (Counter != 0) {
51     printf("TEST 46 FAILED. Counter = %d\n\r", Counter);
52     return -1;
53   }
54 
55   return 0;
56 }
57