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[] = "seh0052.c";
9 int perfect;
10 
11 LONG Echo(LONG Value) { return Value; }
12 
13 int main() {
14   LONG Counter;
15   ULONG Index1;
16 
17   Counter = 0;
18 
19   try {
20     for (Index1 = 0; Index1 < 10; Index1 += 1) {
21       if (Echo(Index1) == Index1) {
22         Counter += 3;
23         leave;
24       }
25       Counter += 100;
26     }
27   }
28   finally {
29     if (AbnormalTermination() == 0) {
30       Counter += 5;
31     }
32   }
33   endtry
34 
35   if (Counter != 8) {
36     printf("TEST 52 FAILED, Counter = %d\n", Counter);
37     return -1;
38   }
39 
40   return 0;
41 }
42