summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other/static11.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/other/static11.C')
-rw-r--r--gcc/testsuite/g++.dg/other/static11.C34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/other/static11.C b/gcc/testsuite/g++.dg/other/static11.C
new file mode 100644
index 000000000..e04cbc154
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/static11.C
@@ -0,0 +1,34 @@
+// This is a copy of g++.old-deja/g++.pt/static11.C which at one
+// time got a SEGV for mmix-knuth-mmixware when compiled with
+// -da (or either -dj or -df).
+// { dg-do compile }
+// { dg-options "-da" }
+
+extern "C" void _exit (int);
+
+int r = 1;
+
+struct A
+{
+ void f(){};
+ A(){ ++r; }
+ ~A(){ r -= 2; _exit (r); }
+};
+
+template<class T>
+struct C
+{
+ C(){ a.f(); }
+ static A a;
+};
+
+template <class T> A C<T>::a;
+typedef C<int> B;
+
+int main()
+{
+ C<int> c;
+ return r;
+}
+
+// { dg-final { cleanup-rtl-dump "*" } }