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[] = "SEH0017.c";
9 
10 int main() {
11 
12   LONG Counter;
13 
14   Counter = 0;
15 
16   try {
17     try {
18       /* set counter = 1 */
19       Counter += 1;
20     }
21     finally {
22       /* set counter = 2 */
23       Counter += 1;
24 #if defined(_MSC_VER) && !defined(__clang__)
25       goto t12; /* can't jump into a try/finally */
26 #endif
27     }
28     endtry
29 
30   t12:
31     ;
32   }
33   finally {
34     /* set counter = 3 */
35     Counter += 1;
36   }
37   endtry
38 
39   if (Counter != 3) {
40     printf("TEST 17 FAILED. Counter = %d\n\r", Counter);
41     return -1;
42   }
43 
44   return 0;
45 }
46