view tests/mini/bug308_double_finally.d @ 1519:6182ceeb336a

LLVM_INSTDIR -> LLVM_INCLUDEDIR fix by d0k.
author Christian Kamm <kamm incasoftware de>
date Mon, 29 Jun 2009 21:44:11 +0200
parents f9285cf14c0d
children
line wrap: on
line source

extern(C) int printf(char*, ...);

long foo(ref int p) {
    try { return 0; }
    finally {
        p++;
        throw new Object;
    }
}

void main() {
    int p = 0;
    try {
        foo(p);
        assert(0);
    } catch {
    }
    printf("Number of types scope(exit) was executed : %d\n", p);
    assert(p == 1);
}