1*fe36f081STimo Kreuzer // Copyright (c) Microsoft. All rights reserved.
2*fe36f081STimo Kreuzer // Licensed under the MIT license. See LICENSE file in the project root for
3*fe36f081STimo Kreuzer // full license information.
4*fe36f081STimo Kreuzer 
5*fe36f081STimo Kreuzer #include <windows.h>
6*fe36f081STimo Kreuzer #include "seh.h"
7*fe36f081STimo Kreuzer 
8*fe36f081STimo Kreuzer char test[] = "seh0055.c";
9*fe36f081STimo Kreuzer 
Echo(LONG Value)10*fe36f081STimo Kreuzer LONG Echo(LONG Value) { return Value; }
11*fe36f081STimo Kreuzer 
main()12*fe36f081STimo Kreuzer int main() {
13*fe36f081STimo Kreuzer   LONG Counter;
14*fe36f081STimo Kreuzer 
15*fe36f081STimo Kreuzer   Counter = 0;
16*fe36f081STimo Kreuzer 
17*fe36f081STimo Kreuzer   try {
18*fe36f081STimo Kreuzer     try {
19*fe36f081STimo Kreuzer       if (Echo(Counter) == Counter) {
20*fe36f081STimo Kreuzer         Counter += 3;
21*fe36f081STimo Kreuzer         leave;
22*fe36f081STimo Kreuzer 
23*fe36f081STimo Kreuzer       } else {
24*fe36f081STimo Kreuzer         Counter += 100;
25*fe36f081STimo Kreuzer       }
26*fe36f081STimo Kreuzer     }
27*fe36f081STimo Kreuzer     finally {
28*fe36f081STimo Kreuzer       if (abnormal_termination() == FALSE) {
29*fe36f081STimo Kreuzer         Counter += 5;
30*fe36f081STimo Kreuzer         leave;
31*fe36f081STimo Kreuzer       }
32*fe36f081STimo Kreuzer     }
33*fe36f081STimo Kreuzer     endtry
34*fe36f081STimo Kreuzer 
35*fe36f081STimo Kreuzer     Counter += 100;
36*fe36f081STimo Kreuzer   }
37*fe36f081STimo Kreuzer   finally {
38*fe36f081STimo Kreuzer     if (abnormal_termination() == FALSE) {
39*fe36f081STimo Kreuzer       Counter += 5;
40*fe36f081STimo Kreuzer     }
41*fe36f081STimo Kreuzer   }
42*fe36f081STimo Kreuzer   endtry
43*fe36f081STimo Kreuzer 
44*fe36f081STimo Kreuzer   if (Counter != 13) {
45*fe36f081STimo Kreuzer     printf("TEST 55 FAILED, Counter = %d\n", Counter);
46*fe36f081STimo Kreuzer     return -1;
47*fe36f081STimo Kreuzer   }
48*fe36f081STimo Kreuzer 
49*fe36f081STimo Kreuzer   return 0;
50*fe36f081STimo Kreuzer }
51