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[] = "SEH0051.c"; 9 10 LONG Echo(LONG Value) { return Value; } 11 12 int main() { 13 LONG Counter; 14 15 Counter = 0; 16 17 try { 18 if (Echo(Counter) == Counter) { 19 Counter += 3; 20 leave; 21 } else { 22 Counter += 100; 23 } 24 } 25 finally { 26 if (AbnormalTermination() == 0) { 27 Counter += 5; 28 } 29 } 30 endtry 31 32 if (Counter != 8) { 33 printf("test 51 failed. Counter = %d\n", Counter); 34 return -1; 35 } 36 37 return 0; 38 } 39