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[] = "SEH0031.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) == 0) { 20 /* continue if index is odd */ 21 continue; 22 } else { 23 /* add 1 to counter if Index is odd */ 24 Counter += 1; 25 } 26 } 27 finally { 28 /* 29 * always hit the finally case, even if "continue" 30 * and add 2 to counter 31 */ 32 Counter += 2; 33 } 34 endtry 35 /* only add 3 if INdex1 is odd */ 36 Counter += 3; 37 } 38 39 if (Counter != 40) { 40 printf("TEST 31 FAILED. Counter = %d\n\r", Counter); 41 return -1; 42 } 43 44 return 0; 45 } 46