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