]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This commit was manufactured by cvs2svn to create branch
authorNo Author <no-author@gcc.gnu.org>
Sun, 11 Jan 2004 19:13:12 +0000 (19:13 +0000)
committerNo Author <no-author@gcc.gnu.org>
Sun, 11 Jan 2004 19:13:12 +0000 (19:13 +0000)
'gcc-3_3-branch'.

From-SVN: r75686

gcc/testsuite/g++.dg/opt/expect2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/rtti/typeid4.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/opt/expect2.C b/gcc/testsuite/g++.dg/opt/expect2.C
new file mode 100644 (file)
index 0000000..1bb5d83
--- /dev/null
@@ -0,0 +1,11 @@
+// PR c++/13392
+// { dg-do compile }
+// { dg-options "-O0" }
+
+extern "C" void abort (void);
+struct X { ~X () throw() {} };
+bool foo (X s = X ()) { return false; }
+void bar ()
+{
+  __builtin_expect (foo () && true, 1) ? 0 : (abort (), 0);
+}
diff --git a/gcc/testsuite/g++.dg/rtti/typeid4.C b/gcc/testsuite/g++.dg/rtti/typeid4.C
new file mode 100644 (file)
index 0000000..e6a1dce
--- /dev/null
@@ -0,0 +1,26 @@
+// { dg-do run }
+// { dg-options "-O2" }
+
+#include <typeinfo>
+#include <iostream>
+
+struct A { virtual ~A () {} };
+
+struct APtr
+{ 
+  APtr (A* p)  : p_ (p) { }
+  A& operator* () const { return *p_; }
+  A* p_;
+};
+
+int main ()
+{ 
+  APtr ap (new A);
+  std::type_info const* const exp = &typeid (*ap);
+  for (bool cont = true; cont; cont = false)
+    { 
+      std::cout << "inner: cont " << cont << std::endl;
+      if (exp) ;
+    }
+}
+