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[] = "SEH0040.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 try { 20 if ((Index1 & 0x1) == 1) { 21 /* end the loop when Index1 is 1 */ 22 break; 23 } else { 24 /* add 1 to Counter if Index is 0 */ 25 Counter += 1; 26 } 27 } 28 finally { 29 /* 30 * add 1 to Counter if Index is 0 31 * and after "break" when Index1 is 1 32 */ 33 Counter += 2; 34 } 35 endtry 36 /* add 1 to Counter if Index is 0 */ 37 Counter += 3; 38 } 39 finally { 40 /* 41 * add 1 to Counter if Index is 0 42 * and after "break" when Index1 is 1 43 */ 44 Counter += 4; 45 } 46 endtry 47 /* add 1 to Counter if Index is 0 */ 48 Counter += 5; 49 } 50 51 if (Counter != 21) { 52 printf("TEST 40 FAILED. Counter = %d\n\r", Counter); 53 return -1; 54 } 55 56 return 0; 57 } 58