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[] = "SEH0030.c";
9 int perfect;
10 
11 int main() {
12   ULONG Index1;
13   LONG Counter;
14 
15   Counter = 0;
16 
17   for (Index1 = 0; Index1 < 10; Index1 += 1) {
18     try {
19       if ((Index1 & 0x1) == 0) {
20         /* do nothing if index1 is even */
21         continue;
22       } else {
23         /* add 1 to counter when Index1 is odd */
24         Counter += 1;
25       }
26     }
27     except(1) { Counter += 40; }
28     endtry
29     /* add 2 to counter when Index1 is odd */
30     Counter += 2;
31   }
32 
33   if (Counter != 15) {
34     printf("TEST 30 FAILED. Counter = %d\n\r", Counter);
35     return -1;
36   }
37 
38   return 0;
39 }
40