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[] = "seh0053.c";
9 
10 #define BLUE 0
11 #define RED 1
12 
13 int main() {
14   LONG Counter;
15   ULONG Index2 = RED;
16 
17   Counter = 0;
18 
19   try {
20     switch (Index2) {
21     case BLUE:
22       break;
23 
24     case RED:
25       Counter += 3;
26       leave;
27     }
28 
29     Counter += 100;
30   }
31   finally {
32     if (abnormal_termination() == FALSE) {
33       Counter += 5;
34     }
35   }
36   endtry
37 
38   if (Counter != 8) {
39     printf("TEST 53 FAILED, Counter = %d\n", Counter);
40     return -1;
41   }
42 
43   return 0;
44 }
45