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[] = "SEH0016.c"; 9 int perfect; 10 11 void rtlRaiseExceptin(DWORD Status) { 12 RaiseException(Status, 0, /*no flags*/ 0, 0); 13 return; 14 } 15 16 int main() { 17 LONG Counter; 18 19 Counter = 0; 20 21 try { 22 try { 23 try { 24 /* set counter = 1 and raise exception */ 25 Counter += 1; 26 rtlRaiseExceptin(EXCEPTION_INT_OVERFLOW); 27 } 28 except(1) { 29 /* set counter = 2 */ 30 Counter += 1; 31 goto t11; /* can't jump into the body of a try/finally */ 32 } 33 endtry 34 } 35 finally { 36 /* set counter = 3 */ 37 Counter += 1; 38 } 39 endtry 40 41 t11: 42 ; 43 } 44 finally { 45 /* set counter = 4 */ 46 Counter += 1; 47 } 48 endtry 49 50 if (Counter != 4) { 51 printf("TEST 16 FAILED. Counter = %d\n\r", Counter); 52 return -1; 53 } 54 55 return 0; 56 } 57