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[] = "SEH0058.c";
9 int perfect;
10 
11 int main() {
12   LONG Counter;
13 
14   Counter = 0;
15 
16   try {
17     Counter += 1;
18     RaiseException(EXCEPTION_INT_OVERFLOW, 0, /* no flags */
19                    0, NULL);
20   }
21   except(Counter) {
22     try {
23       Counter += 3;
24       RaiseException(EXCEPTION_INT_OVERFLOW, 0, /* no flags */
25                      0, NULL);
26     }
27     except(Counter - 3) { Counter += 5; }
28     endtry
29   }
30   endtry
31 
32   if (Counter != 9) {
33     printf("TEST 58 FAILED.  Counter = %d\n\r", Counter);
34     return -1;
35   }
36 
37   return 0;
38 }
39