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[] = "SEH0002.c";
9 int perfect;
10 
11 int main() {
12 
13   LONG Counter;
14 
15   Counter = 0;
16 
17   try {
18     Counter += 1;
19   }
20   except(Counter)
21   /*
22    * counter should be positive indicating "EXECUTE HANDLER"
23    * but should never get here as no exception is raised
24    */
25   {
26     Counter += 1;
27   }
28   endtry
29 
30   if (Counter != 1) {
31     printf("TEST 2 FAILED.  Counter = %d\n\r", Counter);
32     return -1;
33   }
34 
35   return 0;
36 }
37