xref: /netbsd-src/external/gpl3/gcc/dist/libphobos/testsuite/libphobos.exceptions/static_dtor.d (revision 181254a7b1bdde6873432bffef2d2decc4b5c22f)
1 // { dg-shouldfail "static_dtor_exception" }
2 // { dg-output "object.Exception@.*: static_dtor_exception" }
3 // https://issues.dlang.org/show_bug.cgi?id=16594
4 import core.stdc.stdio;
5 
~this()6 shared static ~this()
7 {
8     __gshared int count;
9 
10     if (count++) fprintf(stderr, "dtor_called_more_than_once");
11     else throw new Exception("static_dtor_exception");
12 }
13 
main()14 void main()
15 {
16 }
17