summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.robertl/eb102.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.robertl/eb102.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb102.C35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb102.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb102.C
new file mode 100644
index 000000000..c82fd56d9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb102.C
@@ -0,0 +1,35 @@
+// { dg-do run }
+// Error: intenral compiler error on 1998/05/28 snapshot.
+#include <stdio.h>
+#include <stdlib.h>
+
+void evilRises (void **ptr)
+{
+ int *pi;
+
+ pi = new int;
+
+ *pi = 0;
+
+ *ptr = (void *)pi;
+}
+
+int main (int argc, char *argv[])
+{
+#ifdef WORKAROUND
+ union foo
+#else
+ union
+#endif
+ {
+ int a;
+ int b;
+ int c;
+ } *fred, barney;
+
+ evilRises((void **)&fred);
+
+ barney = *fred;
+
+ return EXIT_SUCCESS;
+}