aboutsummaryrefslogtreecommitdiff
path: root/libphobos/testsuite/libphobos.exceptions/rt_trap_exceptions.d
blob: bd0c227e0f6ec0d5d5bc59106bce1ced6e6511ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// { dg-shouldfail "uncaught exception" }
// { dg-output "gcc.deh.*: uncaught exception" }
// Code adapted from
// http://arsdnet.net/this-week-in-d/2016-aug-07.html
extern extern(C) __gshared bool rt_trapExceptions;
extern extern(C) int _d_run_main(int, char**, void*) @system;

extern(C) int main(int argc, char** argv) {
    rt_trapExceptions = false;
    return _d_run_main(argc, argv, &_main);
}

int _main() {
    throw new Exception("this will abort");
}