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[] = "SEH0038.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) == 1) { 20 /* end the for loop when index is 1 */ 21 break; 22 } else { 23 /* add 1 to counter when Index1 is 0 */ 24 Counter += 1; 25 } 26 } 27 finally { 28 /* add 2 to counter when Index1 is 0 and 1 */ 29 Counter += 2; 30 } 31 endtry 32 /* add 3 to counter when Index1 is 0 */ 33 Counter += 3; 34 } 35 36 if (Counter != 8) { 37 printf("TEST 38 FAILED. Counter = %d\n\r", Counter); 38 return -1; 39 } 40 41 return 0; 42 } 43