public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Some testsuite cleanup
@ 2016-07-28 21:06 Jonathan Wakely
  2016-07-31 19:22 ` Jonathan Wakely
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jonathan Wakely @ 2016-07-28 21:06 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 3119 bytes --]

This is a set of small patches for issues in the testsuite that I
noticed while working on a big change (coming soon).

Self-explanatory:

    Fix invalid dg-do directives in libstdc++ tests
    
        * testsuite/22_locale/conversions/string/1.cc: Remove unintended
        dg-do compile directive.
        * testsuite/26_numerics/headers/cmath/fabs_inline.cc: Fix syntax of
        dg-do directive.
        * testsuite/26_numerics/valarray/const_bracket.cc: Likewise.

The dg-options for FreeBSD and Dragonfly should have included
-std=gnu++11, or should have used dg-additional-options to add to,
rather than override, the common dg-options.

    Use dg-additional-options in libstdc++ tests
    
        * testsuite/17_intro/headers/c++2011/stdc++.cc: Change target-specific
        dg-options to dg-additional-options so that default options are used.
        * testsuite/17_intro/headers/c++2011/stdc++_multiple_inclusion.cc:
        Likewise.
        * testsuite/17_intro/headers/c++2014/stdc++.cc: Likewise.
        * testsuite/17_intro/headers/c++2014/stdc++_multiple_inclusion.cc:
        Likewise.
        * testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc:
        Use dg-additional-options instead of repeating the common options.

When I added _Temporary_object to vector recently I updated the
construct/destroy counts in this test to match, but the changes only
apply for C++11 and later. This makes the test pass whether run as
C++98 or C++11 and later.

    Fix std::vector test to pass in C++98 mode
    
        * testsuite/23_containers/vector/check_construct_destroy.cc: Account
        for different construct/destroy counts in C++98 mode.

The dg-prune-output directives in these tests are needed to prune some
additional errors that are only issued in C++98 mode, but the line
numbers had got out of date. I've replaced the hardcoded numbers with
strings that will stay valid.

    Fix DR 438 container tests to pass in C++98 mode
    
        * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
        Adjust dg-prune-output pattern for error in C++98 mode.
        * testsuite/23_containers/deque/requirements/dr438/
        constructor_1_neg.cc: Likewise.
        * testsuite/23_containers/deque/requirements/dr438/
        constructor_2_neg.cc: Likewise.
        * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
        Likewise.
        * testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
        Likewise.
        * testsuite/23_containers/list/requirements/dr438/
        constructor_1_neg.cc: Likewise.
        * testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
        Likewise.
        * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
        Likewise.
        * testsuite/23_containers/vector/requirements/dr438/
        constructor_1_neg.cc: Likewise.
        * testsuite/23_containers/vector/requirements/dr438/
        constructor_2_neg.cc: Likewise.
        * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
        Likewise.

Tested x86_64-linux, committed to trunk.



[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 15089 bytes --]

commit 9afdeaa821412a2311a4ede6b77b032a99a94f2f
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Jul 28 21:13:59 2016 +0100

    Fix DR 438 container tests to pass in C++98 mode
    
    	* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
    	Adjust dg-prune-output pattern for error in C++98 mode.
    	* testsuite/23_containers/deque/requirements/dr438/
    	constructor_1_neg.cc: Likewise.
    	* testsuite/23_containers/deque/requirements/dr438/
    	constructor_2_neg.cc: Likewise.
    	* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
    	Likewise.
    	* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
    	Likewise.
    	* testsuite/23_containers/list/requirements/dr438/
    	constructor_1_neg.cc: Likewise.
    	* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
    	Likewise.
    	* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
    	Likewise.
    	* testsuite/23_containers/vector/requirements/dr438/
    	constructor_1_neg.cc: Likewise.
    	* testsuite/23_containers/vector/requirements/dr438/
    	constructor_2_neg.cc: Likewise.
    	* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
    	Likewise.

diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
index 7851243..49a05e6 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-prune-output 1879 }
+// { dg-prune-output "no matching function .*_M_fill_assign" }
 
 #include <deque>
 
diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
index 2debd58..7b52fe2 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-prune-output 1812 }
+// { dg-prune-output "no matching function .*_M_fill_initialize" }
 
 #include <deque>
 
diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
index 5aa8626..02a2d3b 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-prune-output 1812 }
+// { dg-prune-output "no matching function .*_M_fill_initialize" }
 
 #include <deque>
 #include <utility>
diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
index 5742198..90c0040 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-prune-output 1963 }
+// { dg-prune-output "no matching function .*_M_fill_insert" }
 
 #include <deque>
 
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc
index b956db6..90e3c07 100644
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-prune-output 1740 }
+// { dg-prune-output "no matching function .*_M_fill_assign" }
 
 #include <list>
 
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc
index 3400695..32815f4 100644
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-prune-output 1692 }
+// { dg-prune-output "no matching function .*_M_fill_initialize" }
 
 #include <list>
 
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc
index 75b33f2..fff543e 100644
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-prune-output 1692 }
+// { dg-prune-output "no matching function .*_M_fill_initialize" }
 
 #include <list>
 
diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
index 898431e..50e665d 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-prune-output 1325 }
+// { dg-prune-output "no matching function .*_M_fill_assign" }
 
 #include <vector>
 
diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
index 3e27d52..c8521b7 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-prune-output 1251 }
+// { dg-prune-output "no matching function .*_M_fill_initialize" }
 
 #include <vector>
 
diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
index 680a84b..bc75eb4 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-prune-output 1251 }
+// { dg-prune-output "no matching function .*_M_fill_initialize" }
 
 #include <vector>
 #include <utility>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
index 9c9dd60..c73f861 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-prune-output 1366 }
+// { dg-prune-output "no matching function .*_M_fill_insert" }
 
 #include <vector>
 

commit 1ba3417ab149d56618163e0106c27a3ad7cec65e
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Jul 28 21:13:30 2016 +0100

    Fix std::vector test to pass in C++98 mode
    
    	* testsuite/23_containers/vector/check_construct_destroy.cc: Account
    	for different construct/destroy counts in C++98 mode.

diff --git a/libstdc++-v3/testsuite/23_containers/vector/check_construct_destroy.cc b/libstdc++-v3/testsuite/23_containers/vector/check_construct_destroy.cc
index b92a152..ddf0f9a 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/check_construct_destroy.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/check_construct_destroy.cc
@@ -44,14 +44,17 @@ int main()
   }
   ok = check_construct_destroy("Construct from range", 10, 10) && ok;
 
+  // For C++11 and later the allocator is used to construct/destroy an
+  // additional temporary object during insertion.
+  const int extra = __cplusplus >= 201102L ? 1 : 0;
   {
     Container c(arr10, arr10 + 10);
     c.reserve(100);
     tracker_allocator_counter::reset();
     c.insert(c.begin(), arr10[0]);
-    ok = check_construct_destroy("Insert element", 2, 1) && ok;
+    ok = check_construct_destroy("Insert element", 1+extra, 0+extra) && ok;
   }
-  ok = check_construct_destroy("Insert element", 2, 12) && ok;
+  ok = check_construct_destroy("Insert element", 1+extra, 11+extra) && ok;
 
   {
     Container c(arr10, arr10 + 10);

commit 6aba5815feb0c5aa346312487005b51450a9a2a6
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Jul 28 20:45:42 2016 +0100

    Use dg-additional-options in libstdc++ tests
    
    	* testsuite/17_intro/headers/c++2011/stdc++.cc: Change target-specific
    	dg-options to dg-additional-options so that default options are used.
    	* testsuite/17_intro/headers/c++2011/stdc++_multiple_inclusion.cc:
    	Likewise.
    	* testsuite/17_intro/headers/c++2014/stdc++.cc: Likewise.
    	* testsuite/17_intro/headers/c++2014/stdc++_multiple_inclusion.cc:
    	Likewise.
    	* testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc:
    	Use dg-additional-options instead of repeating the common options.

diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++.cc
index 26a0e42..40bced7 100644
--- a/libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++.cc
@@ -1,6 +1,6 @@
 // FreeBSD wants warning clean system headers:
-// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } }
 // { dg-options "-std=gnu++11" }
+// { dg-additional-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } }
 // { dg-do compile }
 
 // Copyright (C) 2007-2016 Free Software Foundation, Inc.
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++_multiple_inclusion.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++_multiple_inclusion.cc
index 69869b7..59f7748 100644
--- a/libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++_multiple_inclusion.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++_multiple_inclusion.cc
@@ -1,6 +1,6 @@
 // FreeBSD wants warning clean system headers:
-// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } }
 // { dg-options "-std=gnu++11" }
+// { dg-additional-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } }
 // { dg-do compile }
 
 // Copyright (C) 2007-2016 Free Software Foundation, Inc.
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2014/stdc++.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2014/stdc++.cc
index 2ab83c7..cd74e7b 100644
--- a/libstdc++-v3/testsuite/17_intro/headers/c++2014/stdc++.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2014/stdc++.cc
@@ -1,6 +1,6 @@
 // FreeBSD wants warning clean system headers:
-// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } }
 // { dg-options "-std=gnu++14" }
+// { dg-additional-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } }
 // { dg-do compile }
 
 // Copyright (C) 2015-2016 Free Software Foundation, Inc.
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2014/stdc++_multiple_inclusion.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2014/stdc++_multiple_inclusion.cc
index 7303143..3805723 100644
--- a/libstdc++-v3/testsuite/17_intro/headers/c++2014/stdc++_multiple_inclusion.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2014/stdc++_multiple_inclusion.cc
@@ -1,6 +1,6 @@
 // FreeBSD wants warning clean system headers:
-// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } }
 // { dg-options "-std=gnu++14" }
+// { dg-additional-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } }
 // { dg-do compile }
 
 // Copyright (C) 2015-2016 Free Software Foundation, Inc.
diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc b/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc
index 560eee3..f4a88f6 100644
--- a/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc
+++ b/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc
@@ -1,6 +1,6 @@
 // { dg-do compile { target i?86-*-* x86_64-*-* } }
 // { dg-options "-std=gnu++11 -g0 -fno-exceptions -fno-asynchronous-unwind-tables" }
-// { dg-options "-std=gnu++11 -g0 -fno-exceptions -fno-asynchronous-unwind-tables -march=i486" { target ia32 } }
+// { dg-additional-options "-march=i486" { target ia32 } }
 // { dg-final { scan-assembler-times "xacquire\|\.byte\[^\n\r]*0xf2" 14 } }
 // { dg-final { scan-assembler-times "xrelease\|\.byte\[^\n\r]*0xf3" 14 } }
 

commit b03d309115041818d6cca013f544e491bb9b34e4
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Jul 28 00:46:17 2016 +0100

    Fix invalid dg-do directives in libstdc++ tests
    
    	* testsuite/22_locale/conversions/string/1.cc: Remove unintended
    	dg-do compile directive.
    	* testsuite/26_numerics/headers/cmath/fabs_inline.cc: Fix syntax of
    	dg-do directive.
    	* testsuite/26_numerics/valarray/const_bracket.cc: Likewise.

diff --git a/libstdc++-v3/testsuite/22_locale/conversions/string/1.cc b/libstdc++-v3/testsuite/22_locale/conversions/string/1.cc
index 9a1e59f..25c0586 100644
--- a/libstdc++-v3/testsuite/22_locale/conversions/string/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/conversions/string/1.cc
@@ -1,4 +1,3 @@
-// { dg-do compile }
 // { dg-options "-std=gnu++11" }
 
 // Copyright (C) 2015-2016 Free Software Foundation, Inc.
diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/fabs_inline.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/fabs_inline.cc
index 2361142..82c5964 100644
--- a/libstdc++-v3/testsuite/26_numerics/headers/cmath/fabs_inline.cc
+++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/fabs_inline.cc
@@ -17,7 +17,7 @@
 
 // Test to see whether the host provides its own (inline) view of fabs.
 // Origin: Kurt Garloff <kurt@garloff.de>, 2001-05-24
-// dg-do link
+// { dg-do link }
 
 #include <cmath>
 #include <cstdio>
diff --git a/libstdc++-v3/testsuite/26_numerics/valarray/const_bracket.cc b/libstdc++-v3/testsuite/26_numerics/valarray/const_bracket.cc
index 6936d15..8dea41f 100644
--- a/libstdc++-v3/testsuite/26_numerics/valarray/const_bracket.cc
+++ b/libstdc++-v3/testsuite/26_numerics/valarray/const_bracket.cc
@@ -20,7 +20,7 @@
 
 #include <valarray>
 
-// dg-do compile
+// { dg-do compile }
 
 template<typename P>
   void copy(P, std::size_t) { }

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch] Some testsuite cleanup
  2016-07-28 21:06 [patch] Some testsuite cleanup Jonathan Wakely
@ 2016-07-31 19:22 ` Jonathan Wakely
  2016-07-31 20:31   ` Jonathan Wakely
  2016-07-31 19:30 ` Jonathan Wakely
  2016-08-01 12:45 ` Jonathan Wakely
  2 siblings, 1 reply; 8+ messages in thread
From: Jonathan Wakely @ 2016-07-31 19:22 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1859 bytes --]

On 28/07/16 22:06 +0100, Jonathan Wakely wrote:
>The dg-prune-output directives in these tests are needed to prune some
>additional errors that are only issued in C++98 mode, but the line
>numbers had got out of date. I've replaced the hardcoded numbers with
>strings that will stay valid.
>
>   Fix DR 438 container tests to pass in C++98 mode
>       * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
>       Adjust dg-prune-output pattern for error in C++98 mode.
>       * testsuite/23_containers/deque/requirements/dr438/
>       constructor_1_neg.cc: Likewise.
>       * testsuite/23_containers/deque/requirements/dr438/
>       constructor_2_neg.cc: Likewise.
>       * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
>       Likewise.
>       * testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
>       Likewise.
>       * testsuite/23_containers/list/requirements/dr438/
>       constructor_1_neg.cc: Likewise.
>       * testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
>       Likewise.
>       * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
>       Likewise.
>       * testsuite/23_containers/vector/requirements/dr438/
>       constructor_1_neg.cc: Likewise.
>       * testsuite/23_containers/vector/requirements/dr438/
>       constructor_2_neg.cc: Likewise.
>       * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
>       Likewise.

I missed one test in the change above. For that test the extra error
in C++98 mode comes from location 1698:29 which doesn't match the 1682
lineno in the test, but instead matches the dg-error on line 29 of the
file. That means it fails if it's run with
--target_board=unix/-fno-show-column/-std=gnu++98

(I'm getting really annoyed with line numbers matching columns!)

Tested x86_64-linux, committed to trunk.



[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 921 bytes --]

commit c9949d54ba1ff875802947e7e7bba63a9a2e1164
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Sun Jul 31 19:58:46 2016 +0100

    Fix DR 438 std::list test to pass in C++98 mode
    
    	* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
    	Adjust dg-prune-output pattern for error in C++98 mode.

diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
index 313c54a..769d615 100644
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-prune-output 1682 }
+// { dg-prune-output "no matching function .*_M_fill_initialize" }
 
 #include <list>
 #include <utility>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch] Some testsuite cleanup
  2016-07-28 21:06 [patch] Some testsuite cleanup Jonathan Wakely
  2016-07-31 19:22 ` Jonathan Wakely
@ 2016-07-31 19:30 ` Jonathan Wakely
  2016-08-01 12:45 ` Jonathan Wakely
  2 siblings, 0 replies; 8+ messages in thread
From: Jonathan Wakely @ 2016-07-31 19:30 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1007 bytes --]

On 28/07/16 22:06 +0100, Jonathan Wakely wrote:
>The dg-options for FreeBSD and Dragonfly should have included
>-std=gnu++11, or should have used dg-additional-options to add to,
>rather than override, the common dg-options.
>
>   Use dg-additional-options in libstdc++ tests
>       * testsuite/17_intro/headers/c++2011/stdc++.cc: Change target-specific
>       dg-options to dg-additional-options so that default options are used.
>       * testsuite/17_intro/headers/c++2011/stdc++_multiple_inclusion.cc:
>       Likewise.
>       * testsuite/17_intro/headers/c++2014/stdc++.cc: Likewise.
>       * testsuite/17_intro/headers/c++2014/stdc++_multiple_inclusion.cc:
>       Likewise.
>       * testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc:
>       Use dg-additional-options instead of repeating the common options.

That last test also needs to ensure optimization is used or the
scan-assembler check FAILs when --target_board=unix/-O0 is used.

Tested x86_64-linux, committed to trunk.



[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 1131 bytes --]

commit 34e4034a9fceed99b0d63ad1f4357ea7920630bb
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Sun Jul 31 20:23:20 2016 +0100

    Ensure std::atomic test is compiled with optimization
    
    	* testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc:
    	Ensure test is compiled with optimization.

diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc b/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc
index f4a88f6..b8f263f 100644
--- a/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc
+++ b/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc
@@ -1,5 +1,5 @@
 // { dg-do compile { target i?86-*-* x86_64-*-* } }
-// { dg-options "-std=gnu++11 -g0 -fno-exceptions -fno-asynchronous-unwind-tables" }
+// { dg-options "-std=gnu++11 -O2 -g0 -fno-exceptions -fno-asynchronous-unwind-tables" }
 // { dg-additional-options "-march=i486" { target ia32 } }
 // { dg-final { scan-assembler-times "xacquire\|\.byte\[^\n\r]*0xf2" 14 } }
 // { dg-final { scan-assembler-times "xrelease\|\.byte\[^\n\r]*0xf3" 14 } }

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch] Some testsuite cleanup
  2016-07-31 19:22 ` Jonathan Wakely
@ 2016-07-31 20:31   ` Jonathan Wakely
  2016-08-01 16:23     ` Mike Stump
  0 siblings, 1 reply; 8+ messages in thread
From: Jonathan Wakely @ 2016-07-31 20:31 UTC (permalink / raw)
  To: libstdc++, gcc-patches; +Cc: Mike Stump

On 31/07/16 20:21 +0100, Jonathan Wakely wrote:
>(I'm getting really annoyed with line numbers matching columns!)

testsuite/20_util/pair/cons/explicit_construct.cc is another one where
this happens. If you remove a blank line near the top of the file it
starts FAILing, because the error at explicit_construct.cc:55:40:
matches a dg-error on line 40.

Whitespace changes that cause testsuite FAILs are infuriating (and
hard to identify sometimes).

On IRC last week I proposed adding -fno-show-column to
libstdc++-v3/scripts/testsuite_flags.in which solves the problem.
Other people suggested I should tweak deajagnu to make it not match
column numbers. I tried various things, and tried to understand how
the front-end tests solve the problem, but simply adding
-fno-show-column seemed the simplest and most robust.

Better ideas would be welcome.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch] Some testsuite cleanup
  2016-07-28 21:06 [patch] Some testsuite cleanup Jonathan Wakely
  2016-07-31 19:22 ` Jonathan Wakely
  2016-07-31 19:30 ` Jonathan Wakely
@ 2016-08-01 12:45 ` Jonathan Wakely
  2 siblings, 0 replies; 8+ messages in thread
From: Jonathan Wakely @ 2016-08-01 12:45 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 818 bytes --]

On 28/07/16 22:06 +0100, Jonathan Wakely wrote:
>When I added _Temporary_object to vector recently I updated the
>construct/destroy counts in this test to match, but the changes only
>apply for C++11 and later. This makes the test pass whether run as
>C++98 or C++11 and later.
>
>   Fix std::vector test to pass in C++98 mode
>       * testsuite/23_containers/vector/check_construct_destroy.cc: Account
>       for different construct/destroy counts in C++98 mode.

The same change is needed for a __gnu_cxx::hash_set test, because that
container uses std::vector internally:

    Fix __gnu_cxx::hash_set test to pass in C++98 mode
    
        * testsuite/backward/hash_set/check_construct_destroy.cc: Account
        for different construct/destroy counts in C++98 mode.

Tested x86_64-linux, committed to trunk.



[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 3388 bytes --]

commit efb4d741206e916e7457ee90867d2de3501d2a06
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Aug 1 13:40:20 2016 +0100

    Fix __gnu_cxx::hash_set test to pass in C++98 mode
    
    	* testsuite/backward/hash_set/check_construct_destroy.cc: Account
    	for different construct/destroy counts in C++98 mode.

diff --git a/libstdc++-v3/testsuite/backward/hash_set/check_construct_destroy.cc b/libstdc++-v3/testsuite/backward/hash_set/check_construct_destroy.cc
index 5740fe1..821cb29 100644
--- a/libstdc++-v3/testsuite/backward/hash_set/check_construct_destroy.cc
+++ b/libstdc++-v3/testsuite/backward/hash_set/check_construct_destroy.cc
@@ -39,48 +39,50 @@ int main()
 
   int buckets;
 
-  // Add 1 to all counts, because the std::vector used internally by the
-  // hashtable creates and destroys a temporary object using the allocator.
+  // For C++11 and later add 1 to all counts, because the std::vector used
+  // internally by the hashtable creates and destroys a temporary object
+  // using its allocator.
+  const int extra = __cplusplus >= 201102L ? 1 : 0;
 
   tracker_allocator_counter::reset();
   {
     Container c;
     buckets = c.bucket_count();
-    ok = check_construct_destroy("empty container", buckets+1, 1) && ok;
+    ok = check_construct_destroy("empty container", buckets+extra, extra) && ok;
   }
-  ok = check_construct_destroy("empty container", buckets+1, buckets+1) && ok;
+  ok = check_construct_destroy("empty container", buckets+extra, buckets+extra) && ok;
 
 
   tracker_allocator_counter::reset();
   {
     Container c(arr10, arr10 + 10);
-    ok = check_construct_destroy("Construct from range", buckets+10+1, 1) && ok;
+    ok = check_construct_destroy("Construct from range", buckets+10+extra, extra) && ok;
   }
-  ok = check_construct_destroy("Construct from range", buckets+10+1, buckets+10+1) && ok;
+  ok = check_construct_destroy("Construct from range", buckets+10+extra, buckets+10+extra) && ok;
 
   tracker_allocator_counter::reset();
   {
     Container c(arr10, arr10 + 10);
     c.insert(arr10a[0]);
-    ok = check_construct_destroy("Insert element", buckets+11+1, 1) && ok;
+    ok = check_construct_destroy("Insert element", buckets+11+extra, extra) && ok;
   }
-  ok = check_construct_destroy("Insert element", buckets+11+1, buckets+11+1) && ok;
+  ok = check_construct_destroy("Insert element", buckets+11+extra, buckets+11+extra) && ok;
 
   tracker_allocator_counter::reset();
   {
     Container c(arr10, arr10 + 10);
     c.insert(arr10a, arr10a+3);
-    ok = check_construct_destroy("Insert short range", buckets+13+1, 1) && ok;
+    ok = check_construct_destroy("Insert short range", buckets+13+extra, extra) && ok;
   }
-  ok = check_construct_destroy("Insert short range", buckets+13+1, buckets+13+1) && ok;
+  ok = check_construct_destroy("Insert short range", buckets+13+extra, buckets+13+extra) && ok;
 
   tracker_allocator_counter::reset();
   {
     Container c(arr10, arr10 + 10);
     c.insert(arr10a, arr10a+10);
-    ok = check_construct_destroy("Insert long range", buckets+20+1, 1) && ok;
+    ok = check_construct_destroy("Insert long range", buckets+20+extra, extra) && ok;
   }
-  ok = check_construct_destroy("Insert long range", buckets+20+1, buckets+20+1) && ok;
+  ok = check_construct_destroy("Insert long range", buckets+20+extra, buckets+20+extra) && ok;
 
   return ok ? 0 : 1;
 }

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch] Some testsuite cleanup
  2016-07-31 20:31   ` Jonathan Wakely
@ 2016-08-01 16:23     ` Mike Stump
  2016-08-01 16:31       ` Jonathan Wakely
  0 siblings, 1 reply; 8+ messages in thread
From: Mike Stump @ 2016-08-01 16:23 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: libstdc++, gcc-patches

On Jul 31, 2016, at 1:30 PM, Jonathan Wakely <jwakely@redhat.com> wrote:
> 
> -fno-show-column 

is a good general option.  If you guys want to add column number test cases, they can avoid it, and test down to the column.  Most people don't care, and most test aren't interested in column testing anyway.  But, if you want to do a sea change, you can add column numbers to every expected line and that way, they all will fail, if any of the numbers go wrong.  If someone wants to sign up for that, it is slightly better, but requires that someone do all the work.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch] Some testsuite cleanup
  2016-08-01 16:23     ` Mike Stump
@ 2016-08-01 16:31       ` Jonathan Wakely
  2016-08-30 15:21         ` Jonathan Wakely
  0 siblings, 1 reply; 8+ messages in thread
From: Jonathan Wakely @ 2016-08-01 16:31 UTC (permalink / raw)
  To: Mike Stump; +Cc: libstdc++, gcc-patches

On 01/08/16 09:23 -0700, Mike Stump wrote:
>On Jul 31, 2016, at 1:30 PM, Jonathan Wakely <jwakely@redhat.com> wrote:
>>
>> -fno-show-column
>
>is a good general option.  If you guys want to add column number test cases, they can avoid it, and test down to the column.  Most people don't care, and most test aren't interested in column testing anyway.  But, if you want to do a sea change, you can add column numbers to every expected line and that way, they all will fail, if any of the numbers go wrong.  If someone wants to sign up for that, it is slightly better, but requires that someone do all the work.

OK, thanks Mike.

I plan to make this change then (rather than adding it to individual
tests as and when we find one that needs it).

--- a/libstdc++-v3/scripts/testsuite_flags.in
+++ b/libstdc++-v3/scripts/testsuite_flags.in
@@ -56,7 +56,7 @@ case ${query} in
       echo ${CC}
       ;;
     --cxxflags)
-      CXXFLAGS_default="-D_GLIBCXX_ASSERT -fmessage-length=0"
+      CXXFLAGS_default="-D_GLIBCXX_ASSERT -fmessage-length=0 -fno-show-column"
       CXXFLAGS_config="@SECTION_FLAGS@ @EXTRA_CXX_FLAGS@"
       echo ${CXXFLAGS_default} ${CXXFLAGS_config} 
       ;;

This adds it to the default flags used for the entire libstdc++ testsuite. 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch] Some testsuite cleanup
  2016-08-01 16:31       ` Jonathan Wakely
@ 2016-08-30 15:21         ` Jonathan Wakely
  0 siblings, 0 replies; 8+ messages in thread
From: Jonathan Wakely @ 2016-08-30 15:21 UTC (permalink / raw)
  To: Mike Stump; +Cc: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1449 bytes --]

On 01/08/16 17:31 +0100, Jonathan Wakely wrote:
>On 01/08/16 09:23 -0700, Mike Stump wrote:
>>On Jul 31, 2016, at 1:30 PM, Jonathan Wakely <jwakely@redhat.com> wrote:
>>>
>>>-fno-show-column
>>
>>is a good general option.  If you guys want to add column number test cases, they can avoid it, and test down to the column.  Most people don't care, and most test aren't interested in column testing anyway.  But, if you want to do a sea change, you can add column numbers to every expected line and that way, they all will fail, if any of the numbers go wrong.  If someone wants to sign up for that, it is slightly better, but requires that someone do all the work.
>
>OK, thanks Mike.
>
>I plan to make this change then (rather than adding it to individual
>tests as and when we find one that needs it).
>
>--- a/libstdc++-v3/scripts/testsuite_flags.in
>+++ b/libstdc++-v3/scripts/testsuite_flags.in
>@@ -56,7 +56,7 @@ case ${query} in
>      echo ${CC}
>      ;;
>    --cxxflags)
>-      CXXFLAGS_default="-D_GLIBCXX_ASSERT -fmessage-length=0"
>+      CXXFLAGS_default="-D_GLIBCXX_ASSERT -fmessage-length=0 -fno-show-column"
>      CXXFLAGS_config="@SECTION_FLAGS@ @EXTRA_CXX_FLAGS@"
>      echo ${CXXFLAGS_default} ${CXXFLAGS_config}       ;;
>
>This adds it to the default flags used for the entire libstdc++ 
>testsuite.

I've also added -fno-show-column on the gcc-6-branch, with this patch.
This makes it easier to backport patches from trunk.


[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 1690 bytes --]

commit aa3fdea285ce29a6444efd0fd87008bbaf960332
Author: redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Tue Aug 2 19:34:15 2016 +0000

    Add -fno-show-column to libstdc++ test flags
    
    Backport from mainline
    2016-08-02  Jonathan Wakely  <jwakely@redhat.com>
    
    	* scripts/testsuite_flags.in: Add -fno-show-column to cxxflags.
    
    Backport from mainline
    2016-07-27  Jonathan Wakely  <jwakely@redhat.com>
    
    	* testsuite/20_util/forward/1_neg.cc: Move dg-error to right line.

diff --git a/libstdc++-v3/scripts/testsuite_flags.in b/libstdc++-v3/scripts/testsuite_flags.in
index ee59167..ea1a464 100755
--- a/libstdc++-v3/scripts/testsuite_flags.in
+++ b/libstdc++-v3/scripts/testsuite_flags.in
@@ -56,7 +56,7 @@ case ${query} in
       echo ${CC}
       ;;
     --cxxflags)
-      CXXFLAGS_default="-D_GLIBCXX_ASSERT -fmessage-length=0"
+      CXXFLAGS_default="-D_GLIBCXX_ASSERT -fmessage-length=0 -fno-show-column"
       CXXFLAGS_config="@SECTION_FLAGS@ @EXTRA_CXX_FLAGS@"
       echo ${CXXFLAGS_default} ${CXXFLAGS_config} 
       ;;
diff --git a/libstdc++-v3/testsuite/20_util/forward/1_neg.cc b/libstdc++-v3/testsuite/20_util/forward/1_neg.cc
index d2f3477..46ba96c 100644
--- a/libstdc++-v3/testsuite/20_util/forward/1_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/forward/1_neg.cc
@@ -27,8 +27,8 @@ template<class T, class A1, class A2>
   std::shared_ptr<T>
   factory(A1&& a1, A2&& a2)
   {
-    return std::shared_ptr<T>(new T(std::forward<A1>(a1),
-				    std::forward<A2>(a2))); // { dg-error "rvalue" }
+    return std::shared_ptr<T>(new T(std::forward<A1>(a1), // { dg-error "rvalue" }
+				    std::forward<A2>(a2)));
   }
 
 struct A

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-08-30 15:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-28 21:06 [patch] Some testsuite cleanup Jonathan Wakely
2016-07-31 19:22 ` Jonathan Wakely
2016-07-31 20:31   ` Jonathan Wakely
2016-08-01 16:23     ` Mike Stump
2016-08-01 16:31       ` Jonathan Wakely
2016-08-30 15:21         ` Jonathan Wakely
2016-07-31 19:30 ` Jonathan Wakely
2016-08-01 12:45 ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).