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[] = "seh0054.c";
9 int perfect;
10 
11 LONG Echo(LONG Value) { return Value; }
12 
13 int main() {
14   LONG Counter;
15 
16   Counter = 0;
17 
18   try {
19     try {
20       if (Echo(Counter) == Counter) {
21         Counter += 3;
22         leave;
23 
24       } else {
25         Counter += 100;
26       }
27     }
28     finally {
29       if (abnormal_termination() == FALSE) {
30         Counter += 5;
31       }
32     }
33     endtry
34 
35     if (Echo(Counter) == Counter) {
36       Counter += 3;
37       leave;
38 
39     } else {
40       Counter += 100;
41     }
42   }
43   finally {
44     if (abnormal_termination() == FALSE) {
45       Counter += 5;
46     }
47   }
48   endtry
49 
50   if (Counter != 16) {
51     printf("TEST 54 FAILED, Counter = %d\n", Counter);
52     return -1;
53   }
54 
55   return 0;
56 }
57