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[] = "SEH0043.c";
9 int perfect;
10 
11 int main() {
12   ULONG Index1;
13   LONG Counter;
14 
15   Counter = 0;
16 
17   for (Index1 = 0; Index1 < 10; Index1 += 1) {
18     try {
19       try {
20         if ((Index1 & 0x1) == 1) {
21           /* never gets here, "break"'s on Index1=0 */
22           Counter += 1;
23         }
24       }
25       finally {
26         /* set counter to 2 */
27         Counter += 2;
28       }
29       endtry
30       /* set counter = 6 */
31       Counter += 4;
32     }
33     finally {
34       /* set counter = 11 */
35       Counter += 5;
36       /* end loop */
37 #if defined(_MSC_VER) && !defined(__clang__)
38       break;
39 #endif
40     }
41     endtry
42 #ifndef _MSC_VER
43     break;
44 #endif
45     /* never gets here due to "break" */
46     Counter += 6;
47   }
48 
49   if (Counter != 11) {
50     printf("TEST 43 FAILED. Counter = %d\n\r", Counter);
51     return -1;
52   }
53 
54   return 0;
55 }
56