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[] = "SEH0036.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) == 0) {
21           /* add 1 if index1 is odd */
22           Counter += 1;
23         }
24       }
25       finally {
26         /* always add 2 */
27         Counter += 2;
28       }
29       endtry
30       /* always add 4 */
31       Counter += 4;
32     }
33     finally {
34       /* always add 5 */
35       Counter += 5;
36 #if defined(_MSC_VER) && !defined(__clang__)
37       continue;
38 #endif
39     }
40     endtry
41     /* never get here due to continue */
42     Counter += 6;
43   }
44 
45   if (Counter != 115) {
46     printf("TEST 36 FAILED. Counter = %d\n\r", Counter);
47     return -1;
48   }
49 
50   return 0;
51 }
52