diff options
Diffstat (limited to 'test/CodeGenCXX/static-init.cpp')
-rw-r--r-- | test/CodeGenCXX/static-init.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGenCXX/static-init.cpp b/test/CodeGenCXX/static-init.cpp index a67d137d6a..750da02603 100644 --- a/test/CodeGenCXX/static-init.cpp +++ b/test/CodeGenCXX/static-init.cpp @@ -34,3 +34,14 @@ inline void h2() { void h3() { h2(); } + +// PR6980: this shouldn't crash +namespace test0 { + struct A { A(); }; + __attribute__((noreturn)) int throw_exception(); + + void test() { + throw_exception(); + static A r; + } +} |