aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/opt/rtti2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/opt/rtti2.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/opt/rtti2.C17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/opt/rtti2.C b/gcc-4.9/gcc/testsuite/g++.dg/opt/rtti2.C
new file mode 100644
index 000000000..ebbe3cdfd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/opt/rtti2.C
@@ -0,0 +1,17 @@
+// { dg-do compile }
+// { dg-options "-O2" }
+// We used to ICE in compare_values as the types for a comparison
+// were not the same kind of types.
+
+struct class1
+{
+ virtual ~class1 ();
+};
+struct class2 : class1 { };
+
+void f(class1 * oo)
+{
+ class2 * oj = dynamic_cast <class2 *>(oo) ;
+ if (oj)
+ delete oo;
+}