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[] = "SEH0050.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           Counter += 1;
28         }
29       }
30       finally { Counter += 2; } endtry
31       Counter += 4;
32     }
33     finally {
34       Counter += 5;
35 #if defined(_MSC_VER) && !defined(__clang__)
36       break;
37 #endif
38     }
39     endtry
40 #ifndef _MSC_VER
41     break;
42 #endif
43     Counter += 6;
44   }
45 
46   if (Counter != 12) {
47     printf("TEST 50 FAILED. Counter = %d\n\r", Counter);
48     return -1;
49   }
50 
51   return 0;
52 }
53