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[] = "SEH0044.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     /* since Index2 starts as 1, should never get here */
22     Counter += 100;
23     break;
24   case 1:
25     try {
26       if ((Index1 & 0x1) == 1) {
27         /*
28          * break out of switch stmt.
29          * leaving COunter as 0
30          */
31         break;
32       } else {
33         Counter += 1;
34       }
35     }
36     except(1)
37     /* never gets here.  No exception occurs */
38     {
39       Counter += 40;
40     }
41     endtry
42     Counter += 2;
43     break;
44   }
45 
46   if (Counter != 0) {
47     printf("TEST 44 FAILED. Counter = %d\n\r", Counter);
48     return -1;
49   }
50 
51   return 0;
52 }
53