Just bail out immediately when emitting an unreachable function-local static
variable.  Surprisingly, this does seem to be the right way to solve this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102961 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/static-init.cpp b/test/CodeGenCXX/static-init.cpp
index a67d137..750da02 100644
--- a/test/CodeGenCXX/static-init.cpp
+++ b/test/CodeGenCXX/static-init.cpp
@@ -34,3 +34,14 @@
 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;
+  }
+}