From eb0619fe9ecacab67eeac90ef58c5235adb07c4c Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Fri, 17 Aug 2007 17:24:22 +0000 Subject: [PATCH] re PR testsuite/31884 (priority_queue_dijkstra.cc operates on deallocated memory) PR testsuite/31884 * testsuite/ext/pb_ds/example/priority_queue_dijkstra.cc (main): Do not access deleted nodes. * testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc, testsuite/25_algorithms/find/istreambuf_iterators/char/2.cc, testsuite/27_io/basic_filebuf/open/char/4.cc, testsuite/27_io/objects/char/9.cc: Use dg-require-fileio. * testsuite/ext/forced_exception_error/cons_virtual_derivation.cc, testsuite/ext/pb_ds/regression/hash_data_map_rand.cc, testsuite/ext/pb_ds/regression/trie_data_map_rand.cc, testsuite/ext/pb_ds/regression/list_update_no_data_map_rand.cc, testsuite/ext/pb_ds/regression/tree_no_data_map_rand.cc, testsuite/ext/pb_ds/regression/list_update_data_map_rand.cc, testsuite/ext/pb_ds/regression/hash_no_data_map_rand.cc, testsuite/ext/pb_ds/regression/priority_queue_rand.cc, testsuite/ext/pb_ds/regression/tree_data_map_rand.cc, testsuite/ext/pb_ds/regression/trie_no_data_map_rand.cc, testsuite/ext/throw_allocator/deallocate_global.cc, testsuite/ext/throw_allocator/check_delete.cc, testsuite/ext/throw_allocator/check_allocate_max_size.cc, testsuite/ext/throw_allocator/check_deallocate_null.cc, testsuite/ext/throw_allocator/check_new.cc, testsuite/ext/throw_allocator/deallocate_local.cc, testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/cons/gen1.cc, testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/gen1.cc, testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/gen1.cc, testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/gen1.cc, testsuite/23_containers/list/modifiers/insert/25288.cc: Use dg-require-time. From-SVN: r127590 --- libstdc++-v3/ChangeLog | 33 +++++++++++++++++++ .../list/modifiers/insert/25288.cc | 2 ++ .../copy/streambuf_iterators/char/4.cc | 2 ++ .../find/istreambuf_iterators/char/2.cc | 2 ++ .../27_io/basic_filebuf/open/char/4.cc | 2 ++ .../testsuite/27_io/objects/char/9.cc | 2 ++ .../cons_virtual_derivation.cc | 2 ++ .../pb_ds/example/priority_queue_dijkstra.cc | 4 +++ .../pb_ds/regression/hash_data_map_rand.cc | 2 ++ .../pb_ds/regression/hash_no_data_map_rand.cc | 2 ++ .../regression/list_update_data_map_rand.cc | 2 ++ .../list_update_no_data_map_rand.cc | 2 ++ .../pb_ds/regression/priority_queue_rand.cc | 2 ++ .../pb_ds/regression/tree_data_map_rand.cc | 2 ++ .../pb_ds/regression/tree_no_data_map_rand.cc | 2 ++ .../pb_ds/regression/trie_data_map_rand.cc | 2 ++ .../pb_ds/regression/trie_no_data_map_rand.cc | 2 ++ .../check_allocate_max_size.cc | 2 ++ .../throw_allocator/check_deallocate_null.cc | 2 ++ .../ext/throw_allocator/check_delete.cc | 2 ++ .../ext/throw_allocator/check_new.cc | 2 ++ .../ext/throw_allocator/deallocate_global.cc | 2 ++ .../ext/throw_allocator/deallocate_local.cc | 2 ++ .../random/linear_congruential/cons/gen1.cc | 2 ++ .../random/mersenne_twister/cons/gen1.cc | 2 ++ .../random/subtract_with_carry/cons/gen1.cc | 2 ++ .../subtract_with_carry_01/cons/gen1.cc | 2 ++ 27 files changed, 87 insertions(+) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index a020f99c375..93443dfbb9f 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,36 @@ +2007-08-17 Daniel Jacobowitz + + PR testsuite/31884 + * testsuite/ext/pb_ds/example/priority_queue_dijkstra.cc (main): Do + not access deleted nodes. + + * testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc, + testsuite/25_algorithms/find/istreambuf_iterators/char/2.cc, + testsuite/27_io/basic_filebuf/open/char/4.cc, + testsuite/27_io/objects/char/9.cc: Use dg-require-fileio. + * testsuite/ext/forced_exception_error/cons_virtual_derivation.cc, + testsuite/ext/pb_ds/regression/hash_data_map_rand.cc, + testsuite/ext/pb_ds/regression/trie_data_map_rand.cc, + testsuite/ext/pb_ds/regression/list_update_no_data_map_rand.cc, + testsuite/ext/pb_ds/regression/tree_no_data_map_rand.cc, + testsuite/ext/pb_ds/regression/list_update_data_map_rand.cc, + testsuite/ext/pb_ds/regression/hash_no_data_map_rand.cc, + testsuite/ext/pb_ds/regression/priority_queue_rand.cc, + testsuite/ext/pb_ds/regression/tree_data_map_rand.cc, + testsuite/ext/pb_ds/regression/trie_no_data_map_rand.cc, + testsuite/ext/throw_allocator/deallocate_global.cc, + testsuite/ext/throw_allocator/check_delete.cc, + testsuite/ext/throw_allocator/check_allocate_max_size.cc, + testsuite/ext/throw_allocator/check_deallocate_null.cc, + testsuite/ext/throw_allocator/check_new.cc, + testsuite/ext/throw_allocator/deallocate_local.cc, + testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/cons/gen1.cc, + testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/gen1.cc, + testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/gen1.cc, + testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/gen1.cc, + testsuite/23_containers/list/modifiers/insert/25288.cc: Use + dg-require-time. + 2007-08-17 Paolo Carlini * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust diff --git a/libstdc++-v3/testsuite/23_containers/list/modifiers/insert/25288.cc b/libstdc++-v3/testsuite/23_containers/list/modifiers/insert/25288.cc index 340f336846d..4faaad688cd 100644 --- a/libstdc++-v3/testsuite/23_containers/list/modifiers/insert/25288.cc +++ b/libstdc++-v3/testsuite/23_containers/list/modifiers/insert/25288.cc @@ -18,6 +18,8 @@ // 23.2.2.3 list modifiers [lib.list.modifiers] +// { dg-require-time "" } + #include #include #include diff --git a/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc b/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc index 378583ac83c..5e838f324e1 100644 --- a/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc +++ b/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc @@ -24,6 +24,8 @@ #include #include +// { dg-require-fileio "" } + // In the occasion of libstdc++/25482 void test01() { diff --git a/libstdc++-v3/testsuite/25_algorithms/find/istreambuf_iterators/char/2.cc b/libstdc++-v3/testsuite/25_algorithms/find/istreambuf_iterators/char/2.cc index 682c515683e..4e815426c3c 100644 --- a/libstdc++-v3/testsuite/25_algorithms/find/istreambuf_iterators/char/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/find/istreambuf_iterators/char/2.cc @@ -23,6 +23,8 @@ #include #include +// { dg-require-fileio "" } + // In the occasion of libstdc++/25482 void test01() { diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/4.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/4.cc index dde8086999a..97200a68f7d 100644 --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/4.cc +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/4.cc @@ -18,6 +18,8 @@ // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. +// { dg-require-fileio "" } + #include #include diff --git a/libstdc++-v3/testsuite/27_io/objects/char/9.cc b/libstdc++-v3/testsuite/27_io/objects/char/9.cc index 6ad7c47278e..4da987b94f8 100644 --- a/libstdc++-v3/testsuite/27_io/objects/char/9.cc +++ b/libstdc++-v3/testsuite/27_io/objects/char/9.cc @@ -17,6 +17,8 @@ // with this library; see the file COPYING. If not, write to the Free // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. + +// { dg-require-fileio "" } #include #include diff --git a/libstdc++-v3/testsuite/ext/forced_exception_error/cons_virtual_derivation.cc b/libstdc++-v3/testsuite/ext/forced_exception_error/cons_virtual_derivation.cc index 4ce8c673700..ae6ef0bd623 100644 --- a/libstdc++-v3/testsuite/ext/forced_exception_error/cons_virtual_derivation.cc +++ b/libstdc++-v3/testsuite/ext/forced_exception_error/cons_virtual_derivation.cc @@ -19,6 +19,8 @@ // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. +// { dg-require-time "" } + #include #include diff --git a/libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_dijkstra.cc b/libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_dijkstra.cc index 53a788d5d55..5eb4549db1b 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_dijkstra.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_dijkstra.cc @@ -151,12 +151,16 @@ int main() // node to the neighbor. const size_t pot_dist = dist + a_a_edge_legnth[node_id][neighbor_i]; + if (a_it[neighbor_i] == a_it[0]) + continue; + // "Relax" the distance (if appropriate) through modify. if (pot_dist < a_it[neighbor_i]->second) p.modify(a_it[neighbor_i], pq_value(neighbor_i, pot_dist)); } // Done with the node, so we pop it. + a_it[node_id] = a_it[0]; p.pop(); } diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_data_map_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_data_map_rand.cc index d82813e729a..91135084c26 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_data_map_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_data_map_rand.cc @@ -45,6 +45,8 @@ * Contains a random-operation test for maps and sets. */ +// { dg-require-time "" } + #include #include diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_no_data_map_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_no_data_map_rand.cc index 652774a39aa..2c55313f65a 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_no_data_map_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_no_data_map_rand.cc @@ -45,6 +45,8 @@ * Contains a random-operation test for maps and sets. */ +// { dg-require-time "" } + #include #include diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_data_map_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_data_map_rand.cc index 98bbf59cf55..6849a02ba37 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_data_map_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_data_map_rand.cc @@ -45,6 +45,8 @@ * Contains a random-operation test for maps and sets. */ +// { dg-require-time "" } + #include #include diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_no_data_map_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_no_data_map_rand.cc index 90e0de038c2..3320e420407 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_no_data_map_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_no_data_map_rand.cc @@ -45,6 +45,8 @@ * Contains a random-operation test for maps and sets. */ +// { dg-require-time "" } + #include #include diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/priority_queue_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/priority_queue_rand.cc index 67e5b6f455a..3860e66eab9 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/priority_queue_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/priority_queue_rand.cc @@ -45,6 +45,8 @@ * Contains a random-operation test for priority queues. */ +// { dg-require-time "" } + #include #include diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_data_map_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_data_map_rand.cc index 645d2eecd05..5a2a29ca67f 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_data_map_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_data_map_rand.cc @@ -45,6 +45,8 @@ * Contains a random-operation test for maps and sets. */ +// { dg-require-time "" } + #include #include diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_no_data_map_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_no_data_map_rand.cc index 1e3a3dbe05e..22f00c49643 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_no_data_map_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_no_data_map_rand.cc @@ -45,6 +45,8 @@ * Contains a random-operation test for maps and sets. */ +// { dg-require-time "" } + #include #include diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_data_map_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_data_map_rand.cc index 90e4fc6129f..61e72bca99a 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_data_map_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_data_map_rand.cc @@ -45,6 +45,8 @@ * Contains a random-operation test for maps and sets. */ +// { dg-require-time "" } + #include #include diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_no_data_map_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_no_data_map_rand.cc index cd1991e73c5..1840ebf39ba 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_no_data_map_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_no_data_map_rand.cc @@ -45,6 +45,8 @@ * Contains a random-operation test for maps and sets. */ +// { dg-require-time "" } + #include #include diff --git a/libstdc++-v3/testsuite/ext/throw_allocator/check_allocate_max_size.cc b/libstdc++-v3/testsuite/ext/throw_allocator/check_allocate_max_size.cc index 902361eff0d..9e5c041f6f5 100644 --- a/libstdc++-v3/testsuite/ext/throw_allocator/check_allocate_max_size.cc +++ b/libstdc++-v3/testsuite/ext/throw_allocator/check_allocate_max_size.cc @@ -17,6 +17,8 @@ // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. +// { dg-require-time "" } + #include #include diff --git a/libstdc++-v3/testsuite/ext/throw_allocator/check_deallocate_null.cc b/libstdc++-v3/testsuite/ext/throw_allocator/check_deallocate_null.cc index 8e6e1a025aa..c49ed2de1e3 100644 --- a/libstdc++-v3/testsuite/ext/throw_allocator/check_deallocate_null.cc +++ b/libstdc++-v3/testsuite/ext/throw_allocator/check_deallocate_null.cc @@ -17,6 +17,8 @@ // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. +// { dg-require-time "" } + #include #include diff --git a/libstdc++-v3/testsuite/ext/throw_allocator/check_delete.cc b/libstdc++-v3/testsuite/ext/throw_allocator/check_delete.cc index a8e716798fe..7dd7b1a2c9c 100644 --- a/libstdc++-v3/testsuite/ext/throw_allocator/check_delete.cc +++ b/libstdc++-v3/testsuite/ext/throw_allocator/check_delete.cc @@ -17,6 +17,8 @@ // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. +// { dg-require-time "" } + #include #include #include diff --git a/libstdc++-v3/testsuite/ext/throw_allocator/check_new.cc b/libstdc++-v3/testsuite/ext/throw_allocator/check_new.cc index 1b00412918f..55c1d2b9483 100644 --- a/libstdc++-v3/testsuite/ext/throw_allocator/check_new.cc +++ b/libstdc++-v3/testsuite/ext/throw_allocator/check_new.cc @@ -17,6 +17,8 @@ // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. +// { dg-require-time "" } + #include #include #include diff --git a/libstdc++-v3/testsuite/ext/throw_allocator/deallocate_global.cc b/libstdc++-v3/testsuite/ext/throw_allocator/deallocate_global.cc index c8bbe510c9b..1eb90ab28e2 100644 --- a/libstdc++-v3/testsuite/ext/throw_allocator/deallocate_global.cc +++ b/libstdc++-v3/testsuite/ext/throw_allocator/deallocate_global.cc @@ -17,6 +17,8 @@ // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. +// { dg-require-time "" } + #include #include #include diff --git a/libstdc++-v3/testsuite/ext/throw_allocator/deallocate_local.cc b/libstdc++-v3/testsuite/ext/throw_allocator/deallocate_local.cc index 794232e914e..d6d57e7e955 100644 --- a/libstdc++-v3/testsuite/ext/throw_allocator/deallocate_local.cc +++ b/libstdc++-v3/testsuite/ext/throw_allocator/deallocate_local.cc @@ -17,6 +17,8 @@ // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. +// { dg-require-time "" } + #include #include #include diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/gen1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/gen1.cc index 3d47cd62ee8..823e66ea0d0 100644 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/gen1.cc +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/gen1.cc @@ -21,6 +21,8 @@ // 5.1.4.1 class template linear_congruential [tr.rand.eng.lcong] // 5.1.1 Table 16 line 3 template ctor(gen) +// { dg-require-time "" } + #include #include #include diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/gen1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/gen1.cc index 7861954a13f..5e4075d24fb 100644 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/gen1.cc +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/gen1.cc @@ -21,6 +21,8 @@ // 5.1.4.2 class template mersenne_twister [tr.rand.eng.mers] // 5.1.1 Table 16 line 3 Gen ctor +// { dg-require-time "" } + #include #include #include diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/gen1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/gen1.cc index 509144563c3..ef583dda341 100644 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/gen1.cc +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/gen1.cc @@ -21,6 +21,8 @@ // 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] // 5.1.1 Table 16 line 3 Gen ctor +// { dg-require-time "" } + #include #include #include diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/cons/gen1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/cons/gen1.cc index 0a95397c518..d7a894b0870 100644 --- a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/cons/gen1.cc +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/cons/gen1.cc @@ -21,6 +21,8 @@ // 5.1.4.4 class template subtract_with_carry_01 [tr.rand.eng.sub1] // 5.1.1 Table 16 line 3 Gen ctor +// { dg-require-time "" } + #include #include #include -- 2.30.2