The commit I pushed was not the one I'd tested, so it had older versions
of the tests, with bugs that I'd already fixed locally. This commit has
the fixed tests that I'd intended to push in the first place.

libstdc++-v3/ChangeLog:

        * testsuite/23_containers/vector/bool/cons/from_range.cc: Use
        dg-do run instead of compile.
        (test_ranges): Use do_test instead of do_test_a for rvalue
        range.
        (test_constexpr): Call function template instead of just
        instantiating it.
        * testsuite/23_containers/vector/bool/modifiers/assign/assign_range.cc:
        Use dg-do run instead of compile.
        (do_test): Use same test logic for vector<bool> as for primary
        template.
        (test_constexpr): Call function template instead of just
        instantiating it.
        * testsuite/23_containers/vector/bool/modifiers/insert/append_range.cc:
        Use dg-do run instead of compile.
        (test_ranges): Use do_test instead of do_test_a for rvalue
        range.
        (test_constexpr): Call function template instead of just
        instantiating it.
        * testsuite/23_containers/vector/bool/modifiers/insert/insert_range.cc:
        Use dg-do run instead of compile.
        (do_test): Fix incorrect function arguments to match intended
        results.
        (test_ranges): Use do_test instead of do_test_a for rvalue
        range.
        (test_constexpr): Call function template instead of just
        instantiating it.
        * testsuite/23_containers/vector/cons/from_range.cc: Use dg-do
        run instead of compile.
        (test_ranges): Fix ill-formed call to do_test.
        (test_constexpr): Call function template instead of just
        instantiating it.
        * testsuite/23_containers/vector/modifiers/append_range.cc:
        Use dg-do run instead of compile.
        (test_constexpr): Likewise.
        * testsuite/23_containers/vector/modifiers/assign/assign_range.cc:
        Use dg-do run instead of compile.
        (do_test): Do not reuse input ranges.
        (test_constexpr): Call function template instead of just
        instantiating it.
        * testsuite/23_containers/vector/modifiers/insert/insert_range.cc:
        Use dg-do run instead of compile.
        (do_test): Fix incorrect function arguments to match intended
        results.
        (test_constexpr): Call function template instead of just
        instantiating it.
---
Tested x86_64-linux. Pushed to trunk.


 .../vector/bool/cons/from_range.cc            |  6 ++--
 .../bool/modifiers/assign/assign_range.cc     | 30 ++++++++++++-------
 .../bool/modifiers/insert/append_range.cc     |  6 ++--
 .../bool/modifiers/insert/insert_range.cc     | 10 +++----
 .../23_containers/vector/cons/from_range.cc   |  6 ++--
 .../vector/modifiers/append_range.cc          |  4 +--
 .../vector/modifiers/assign/assign_range.cc   | 25 +++++++---------
 .../vector/modifiers/insert/insert_range.cc   |  8 ++---
 8 files changed, 50 insertions(+), 45 deletions(-)

diff --git 
a/libstdc++-v3/testsuite/23_containers/vector/bool/cons/from_range.cc 
b/libstdc++-v3/testsuite/23_containers/vector/bool/cons/from_range.cc
index f5180e5a243..f531e7f5039 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/bool/cons/from_range.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/bool/cons/from_range.cc
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++23 } }
+// { dg-do run { target c++23 } }
 
 #include <vector>
 #include <span>
@@ -71,7 +71,7 @@ test_ranges()
     bool val;
   };
   using rvalue_input_range = test_range<C, input_iterator_wrapper_rval>;
-  do_test_a<rvalue_input_range>();
+  do_test<rvalue_input_range>(std::allocator<int>());
 
   return true;
 }
@@ -80,7 +80,7 @@ constexpr bool
 test_constexpr()
 {
   // XXX: this doesn't test the non-forward_range code paths are constexpr.
-  do_test<std::span<bool>, std::allocator<bool>>;
+  do_test<std::span<bool>>(std::allocator<bool>());
   return true;
 }
 
diff --git 
a/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/assign/assign_range.cc
 
b/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/assign/assign_range.cc
index a014dfe90de..7e58700ff2b 100644
--- 
a/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/assign/assign_range.cc
+++ 
b/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/assign/assign_range.cc
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++23 } }
+// { dg-do run { target c++23 } }
 
 #include <vector>
 #include <span>
@@ -22,29 +22,37 @@ do_test()
     return true;
   };
 
-  Range r4(a, a+4);
-  Range r9(a);
-
+  // assign to empty vector
   std::vector<bool, Alloc> v;
   v.assign_range(Range(a, a));
   VERIFY( v.empty() );
   VERIFY( v.capacity() == 0 );
-  v.assign_range(r4);
+  v.assign_range(Range(a, a+4));
   VERIFY( eq(v, {a, 4}) );
   v.clear();
-  v.assign_range(r9); // larger than v.capacity()
+  v.assign_range(Range(a)); // larger than v.capacity()
   VERIFY( eq(v, a) );
-  v.assign_range(r9); // equal to size() and equal to capacity()
+  v.clear();
+  v.assign_range(Range(a, a+4)); // smaller than v.capacity()
+  VERIFY( eq(v, {a, 4}) );
+  v.clear();
+  v.assign_range(Range(a)); // equal to v.capacity()
+  VERIFY( eq(v, a) );
+
+  // assign to non-empty vector
+  v.assign_range(Range(a, a+4)); // smaller than size()
+  VERIFY( eq(v, {a, 4}) );
+  v.assign_range(Range(a)); // larger than size(), equal to capacity()
   VERIFY( eq(v, a) );
   v.resize(1);
-  v.assign_range(r4); // larger than size(), smaller than capacity()
+  v.assign_range(Range(a, a+4)); // larger than size(), smaller than capacity()
   VERIFY( eq(v, {a, 4}) );
   v.clear();
   v.resize(4);
-  v.assign_range(r4); // equal to size(), smaller than capacity()
+  v.assign_range(Range(a, a+4)); // equal to size(), smaller than capacity()
   VERIFY( eq(v, {a, 4}) );
   v.shrink_to_fit();
-  v.assign_range(r9); // larger than capacity()
+  v.assign_range(Range(a)); // larger than capacity()
   VERIFY( eq(v, a) );
   v.assign_range(Range(a, a));
   VERIFY( v.empty() );
@@ -95,7 +103,7 @@ constexpr bool
 test_constexpr()
 {
   // XXX: this doesn't test the non-forward_range code paths are constexpr.
-  do_test<std::span<short>, std::allocator<bool>>;
+  do_test<std::span<short>, std::allocator<bool>>();
   return true;
 }
 
diff --git 
a/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/append_range.cc
 
b/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/append_range.cc
index e811a1697e0..a35ed0f2026 100644
--- 
a/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/append_range.cc
+++ 
b/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/append_range.cc
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++23 } }
+// { dg-do run { target c++23 } }
 
 #include <vector>
 #include <span>
@@ -73,7 +73,7 @@ test_ranges()
     bool val;
   };
   using rvalue_input_range = test_range<C, input_iterator_wrapper_rval>;
-  do_test_a<rvalue_input_range>();
+  do_test<rvalue_input_range, std::allocator<bool>>();
 
   return true;
 }
@@ -82,7 +82,7 @@ constexpr bool
 test_constexpr()
 {
   // XXX: this doesn't test the non-forward_range code paths are constexpr.
-  do_test<std::span<short>, std::allocator<bool>>;
+  do_test<std::span<short>, std::allocator<bool>>();
   return true;
 }
 
diff --git 
a/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/insert_range.cc
 
b/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/insert_range.cc
index 82b67cdb8b9..4f4835746ea 100644
--- 
a/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/insert_range.cc
+++ 
b/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/insert_range.cc
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++23 } }
+// { dg-do run { target c++23 } }
 
 #include <vector>
 #include <span>
@@ -29,7 +29,7 @@ do_test()
   v.insert_range(v.begin(), Range(a, a+4));
   VERIFY( eq(v, {a, a+4}) );
   v.clear();
-  v.insert_range(v.begin(), Range(a, a+5));
+  v.insert_range(v.begin(), Range(a+4, a+9));
   VERIFY( eq(v, {a+4, a+9}) );
   v.insert_range(v.begin(), Range(a, a+4));
   VERIFY( eq(v, a) );
@@ -41,7 +41,7 @@ do_test()
   VERIFY( eq(v, a) );
   v.resize(3);
   v.insert_range(v.begin()+1, Range(a+4, a+9));
-  v.insert_range(v.begin()+1, Range(a+1, a+3));
+  v.insert_range(v.begin()+1, Range(a+1, a+4));
   v.resize(9);
   VERIFY( eq(v, a) );
   v.insert_range(v.begin(), Range(a, a));
@@ -84,7 +84,7 @@ test_ranges()
     bool val;
   };
   using rvalue_input_range = test_range<C, input_iterator_wrapper_rval>;
-  do_test_a<rvalue_input_range>();
+  do_test<rvalue_input_range, std::allocator<bool>>();
 
   return true;
 }
@@ -93,7 +93,7 @@ constexpr bool
 test_constexpr()
 {
   // XXX: this doesn't test the non-forward_range code paths are constexpr.
-  do_test<std::span<bool>, std::allocator<bool>>;
+  do_test<std::span<bool>, std::allocator<bool>>();
   return true;
 }
 
diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/from_range.cc 
b/libstdc++-v3/testsuite/23_containers/vector/cons/from_range.cc
index d709c77720d..e91465f5a71 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/cons/from_range.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/cons/from_range.cc
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++23 } }
+// { dg-do run { target c++23 } }
 
 #include <vector>
 #include <span>
@@ -88,7 +88,7 @@ test_ranges()
     int val;
   };
   using rvalue_input_range = test_range<C, input_iterator_wrapper_rval>;
-  do_test<rvalue_input_range, std::allocator<int>>();
+  do_test<rvalue_input_range>(std::allocator<int>());
 
   return true;
 }
@@ -97,7 +97,7 @@ constexpr bool
 test_constexpr()
 {
   // XXX: this doesn't test the non-forward_range code paths are constexpr.
-  do_test<std::span<short>, std::allocator<int>>;
+  do_test<std::span<short>>(std::allocator<int>());
   return true;
 }
 
diff --git 
a/libstdc++-v3/testsuite/23_containers/vector/modifiers/append_range.cc 
b/libstdc++-v3/testsuite/23_containers/vector/modifiers/append_range.cc
index ff86cb74557..24a5c7d0e7c 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/modifiers/append_range.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/modifiers/append_range.cc
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++23 } }
+// { dg-do run { target c++23 } }
 
 #include <vector>
 #include <span>
@@ -86,7 +86,7 @@ constexpr bool
 test_constexpr()
 {
   // XXX: this doesn't test the non-forward_range code paths are constexpr.
-  do_test<std::span<short>, std::allocator<int>>;
+  do_test<std::span<short>, std::allocator<int>>();
   return true;
 }
 
diff --git 
a/libstdc++-v3/testsuite/23_containers/vector/modifiers/assign/assign_range.cc 
b/libstdc++-v3/testsuite/23_containers/vector/modifiers/assign/assign_range.cc
index c3302e98849..4e8d8af1614 100644
--- 
a/libstdc++-v3/testsuite/23_containers/vector/modifiers/assign/assign_range.cc
+++ 
b/libstdc++-v3/testsuite/23_containers/vector/modifiers/assign/assign_range.cc
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++23 } }
+// { dg-do run { target c++23 } }
 
 #include <vector>
 #include <span>
@@ -26,40 +26,37 @@ do_test()
     return true;
   };
 
-  Range r4(a, a+4);
-  Range r9(a);
-
   // assign to empty vector
   std::vector<V, Alloc> v;
   v.assign_range(Range(a, a));
   VERIFY( v.empty() );
   VERIFY( v.capacity() == 0 );
-  v.assign_range(r4);
+  v.assign_range(Range(a, a+4));
   VERIFY( eq(v, {a, 4}) );
   v.clear();
-  v.assign_range(r9); // larger than v.capacity()
+  v.assign_range(Range(a)); // larger than v.capacity()
   VERIFY( eq(v, a) );
   v.clear();
-  v.assign_range(r4); // smaller than v.capacity()
+  v.assign_range(Range(a, a+4)); // smaller than v.capacity()
   VERIFY( eq(v, {a, 4}) );
   v.clear();
-  v.assign_range(r9); // equal to v.capacity()
+  v.assign_range(Range(a)); // equal to v.capacity()
   VERIFY( eq(v, a) );
 
   // assign to non-empty vector
-  v.assign_range(r4); // smaller than size()
+  v.assign_range(Range(a, a+4)); // smaller than size()
   VERIFY( eq(v, {a, 4}) );
-  v.assign_range(r9); // larger than size(), equal to capacity()
+  v.assign_range(Range(a)); // larger than size(), equal to capacity()
   VERIFY( eq(v, a) );
   v.resize(1);
-  v.assign_range(r4); // larger than size(), smaller than capacity()
+  v.assign_range(Range(a, a+4)); // larger than size(), smaller than capacity()
   VERIFY( eq(v, {a, 4}) );
   v.clear();
   v.resize(4);
-  v.assign_range(r4); // equal to size(), smaller than capacity()
+  v.assign_range(Range(a, a+4)); // equal to size(), smaller than capacity()
   VERIFY( eq(v, {a, 4}) );
   v.shrink_to_fit();
-  v.assign_range(r9); // larger than capacity()
+  v.assign_range(Range(a)); // larger than capacity()
   VERIFY( eq(v, a) );
   v.assign_range(Range(a, a));
   VERIFY( v.empty() );
@@ -110,7 +107,7 @@ constexpr bool
 test_constexpr()
 {
   // XXX: this doesn't test the non-forward_range code paths are constexpr.
-  do_test<std::span<short>, std::allocator<int>>;
+  do_test<std::span<short>, std::allocator<int>>();
   return true;
 }
 
diff --git 
a/libstdc++-v3/testsuite/23_containers/vector/modifiers/insert/insert_range.cc 
b/libstdc++-v3/testsuite/23_containers/vector/modifiers/insert/insert_range.cc
index 4cfab10eb4c..30219f5da02 100644
--- 
a/libstdc++-v3/testsuite/23_containers/vector/modifiers/insert/insert_range.cc
+++ 
b/libstdc++-v3/testsuite/23_containers/vector/modifiers/insert/insert_range.cc
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++23 } }
+// { dg-do run { target c++23 } }
 
 #include <vector>
 #include <span>
@@ -33,7 +33,7 @@ do_test()
   v.insert_range(v.begin(), Range(a, a+4));
   VERIFY( eq(v, {a, a+4}) );
   v.clear();
-  v.insert_range(v.begin(), Range(a, a+5));
+  v.insert_range(v.begin(), Range(a+4, a+9));
   VERIFY( eq(v, {a+4, a+9}) );
   v.insert_range(v.begin(), Range(a, a+4));
   VERIFY( eq(v, a) );
@@ -45,7 +45,7 @@ do_test()
   VERIFY( eq(v, a) );
   v.resize(3);
   v.insert_range(v.begin()+1, Range(a+4, a+9));
-  v.insert_range(v.begin()+1, Range(a+1, a+3));
+  v.insert_range(v.begin()+1, Range(a+1, a+4));
   v.resize(9);
   VERIFY( eq(v, a) );
   v.insert_range(v.begin() + 6, Range(a, a));
@@ -97,7 +97,7 @@ constexpr bool
 test_constexpr()
 {
   // XXX: this doesn't test the non-forward_range code paths are constexpr.
-  do_test<std::span<short>, std::allocator<int>>;
+  do_test<std::span<short>, std::allocator<int>>();
   return true;
 }
 
-- 
2.47.0

Reply via email to