Patchwork C++ testsuite PATCHes to work better in C++0x mode

login
register
mail settings
Submitter Jason Merrill
Date Feb. 10, 2011, 4:29 p.m.
Message ID <4D54125B.6080203@redhat.com>
Download mbox | patch
Permalink /patch/82625/
State New
Headers show

Comments

Jason Merrill - Feb. 10, 2011, 4:29 p.m.
Here are a couple of patches to avoid spurious failures in the testsuite 
when it's run in C++0x mode (i.e. with --target_board=unix/-std=gnu++0x)

Tested x86_64-pc-linux-gnu, applied to trunk.
commit e8dbd65872fb8a2373206a9b96e47323aed5f411
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Feb 9 21:51:16 2011 -0500

    	* g++.dg/tree-ssa/inline-3.C: Use a normal function
    	rather than misdeclare std::puts.
commit c870aee8f2de2c0b7a9b9a146cdd65860e145fa2
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Jan 31 17:00:41 2011 -0500

    	* g++.dg/ext/vla1.C: Adjust for C++0x mode.
    	* g++.dg/other/warning1.C: Likewise.
    	* g++.old-deja/g++.bugs/900119_01.C: Likewise.
    	* g++.old-deja/g++.gb/scope06.C: Likewise.
    	* g++.old-deja/g++.law/cvt11.C: Likewise.
    	* g++.old-deja/g++.law/init1.C: Likewise.
    	* g++.dg/abi/mangle26.C: Likewise.

diff --git a/gcc/testsuite/g++.dg/abi/mangle26.C b/gcc/testsuite/g++.dg/abi/mangle26.C
index 77b0eab..5d16095 100644
--- a/gcc/testsuite/g++.dg/abi/mangle26.C
+++ b/gcc/testsuite/g++.dg/abi/mangle26.C
@@ -5,7 +5,7 @@
 
 namespace std {
   struct A {
-    virtual void f () { }
+    A() { }
   };
 }
 
diff --git a/gcc/testsuite/g++.dg/ext/vla1.C b/gcc/testsuite/g++.dg/ext/vla1.C
index fad67ce..f372535 100644
--- a/gcc/testsuite/g++.dg/ext/vla1.C
+++ b/gcc/testsuite/g++.dg/ext/vla1.C
@@ -22,5 +22,5 @@ B::B (int i)
     int ar[1][i];  // { dg-error "array" }
   } s;
 
-  s.ar[0][0] = 0;  // { dg-error "no member" }
+  s.ar[0][0] = 0;  // { dg-prune-output "no member" }
 }
diff --git a/gcc/testsuite/g++.dg/other/warning1.C b/gcc/testsuite/g++.dg/other/warning1.C
index a5cce6c..77653a1 100644
--- a/gcc/testsuite/g++.dg/other/warning1.C
+++ b/gcc/testsuite/g++.dg/other/warning1.C
@@ -13,6 +13,7 @@ struct S
 
 int main()
 {
+  // { dg-prune-output "not a member" }
   printf("%f\n%f\n", S::inf, S::nan);
   return 0;
 }
diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900119_01.C b/gcc/testsuite/g++.old-deja/g++.bugs/900119_01.C
index 01d570f..ace4e4b 100644
--- a/gcc/testsuite/g++.old-deja/g++.bugs/900119_01.C
+++ b/gcc/testsuite/g++.old-deja/g++.bugs/900119_01.C
@@ -8,6 +8,8 @@
 
 // keywords: member declaration, member initialization
 
+// { dg-prune-output "non-static data member initializers" }
+
 int global_int;
 
 class class0 {
diff --git a/gcc/testsuite/g++.old-deja/g++.gb/scope06.C b/gcc/testsuite/g++.old-deja/g++.gb/scope06.C
index 39ab089..cbcc4fd 100644
--- a/gcc/testsuite/g++.old-deja/g++.gb/scope06.C
+++ b/gcc/testsuite/g++.old-deja/g++.gb/scope06.C
@@ -1,4 +1,5 @@
 // { dg-do assemble  }
+// { dg-prune-output "non-static data member initializers" }
 // GROUPS passed gb scope
 struct C {
   struct D {
@@ -10,5 +11,6 @@ struct C {
 
 void C::D::foo ()
 {
+  // { dg-prune-output "from this location" }
   x = Ok;
 }
diff --git a/gcc/testsuite/g++.old-deja/g++.law/cvt11.C b/gcc/testsuite/g++.old-deja/g++.law/cvt11.C
index 50f719a..53dd1e9 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/cvt11.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/cvt11.C
@@ -6,6 +6,10 @@
 // Message-Id: <9211101908.AA13557@tera.com>
 // Subject: type cast of qualified const member breaks g++2.3.1
 
+// Ignore extra errors in C++0x mode.
+// { dg-prune-output "non-static data member initializers" }
+// { dg-prune-output "from this location" }
+// { dg-prune-output "uninitialized" }
 #include <stdio.h>
 
 class Thing{
diff --git a/gcc/testsuite/g++.old-deja/g++.law/init1.C b/gcc/testsuite/g++.old-deja/g++.law/init1.C
index 82f49ae..1727e38 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/init1.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/init1.C
@@ -1,4 +1,5 @@
 // { dg-do assemble  }
+// { dg-prune-output "non-static data member initializers" }
 // GROUPS passed initialization
 class foo {
 public:

Patch

diff --git a/gcc/testsuite/g++.dg/tree-ssa/inline-3.C b/gcc/testsuite/g++.dg/tree-ssa/inline-3.C
index 57d175c..f01f26c 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/inline-3.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/inline-3.C
@@ -4,20 +4,18 @@ 
 
 #include <algorithm>
 
-namespace std {
-  extern "C" void puts(const char *s);
-}
+void foo(const char *s);
 
 void
 inline_me (char *x)
 {
-  std::puts(x);
+  foo(x);
 }
 
 static void
 inline_me_too (char *x)
 {
-  std::puts(x);
+  foo(x);
 }
 
 int main(int argc, char **argv)