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[] = "SEH0051.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     if (Echo(Counter) == Counter) {
20       Counter += 3;
21       leave;
22     } else {
23       Counter += 100;
24     }
25   }
26   finally {
27     if (AbnormalTermination() == 0) {
28       Counter += 5;
29     }
30   }
31   endtry
32 
33   if (Counter != 8) {
34     printf("test 51 failed.  Counter = %d\n", Counter);
35     return -1;
36   }
37 
38   return 0;
39 }
40