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