re PR testsuite/31884 (priority_queue_dijkstra.cc operates on deallocated memory)
authorDaniel Jacobowitz <dan@codesourcery.com>
Fri, 17 Aug 2007 17:24:22 +0000 (17:24 +0000)
committerDaniel Jacobowitz <drow@gcc.gnu.org>
Fri, 17 Aug 2007 17:24:22 +0000 (17:24 +0000)
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

27 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/23_containers/list/modifiers/insert/25288.cc
libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc
libstdc++-v3/testsuite/25_algorithms/find/istreambuf_iterators/char/2.cc
libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/4.cc
libstdc++-v3/testsuite/27_io/objects/char/9.cc
libstdc++-v3/testsuite/ext/forced_exception_error/cons_virtual_derivation.cc
libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_dijkstra.cc
libstdc++-v3/testsuite/ext/pb_ds/regression/hash_data_map_rand.cc
libstdc++-v3/testsuite/ext/pb_ds/regression/hash_no_data_map_rand.cc
libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_data_map_rand.cc
libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_no_data_map_rand.cc
libstdc++-v3/testsuite/ext/pb_ds/regression/priority_queue_rand.cc
libstdc++-v3/testsuite/ext/pb_ds/regression/tree_data_map_rand.cc
libstdc++-v3/testsuite/ext/pb_ds/regression/tree_no_data_map_rand.cc
libstdc++-v3/testsuite/ext/pb_ds/regression/trie_data_map_rand.cc
libstdc++-v3/testsuite/ext/pb_ds/regression/trie_no_data_map_rand.cc
libstdc++-v3/testsuite/ext/throw_allocator/check_allocate_max_size.cc
libstdc++-v3/testsuite/ext/throw_allocator/check_deallocate_null.cc
libstdc++-v3/testsuite/ext/throw_allocator/check_delete.cc
libstdc++-v3/testsuite/ext/throw_allocator/check_new.cc
libstdc++-v3/testsuite/ext/throw_allocator/deallocate_global.cc
libstdc++-v3/testsuite/ext/throw_allocator/deallocate_local.cc
libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/gen1.cc
libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/gen1.cc
libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/gen1.cc
libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/cons/gen1.cc

index a020f99c375a61c98311d1535aa6a9ebe53cffda..93443dfbb9f062c6a4059feb9ac5bf07949b18e9 100644 (file)
@@ -1,3 +1,36 @@
+2007-08-17  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       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  <pcarlini@suse.de>
 
        * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust
index 340f336846dc78238f8b16d6fb1348b3cf37362b..4faaad688cd8d2e135581068f6f506122c6c5d5a 100644 (file)
@@ -18,6 +18,8 @@
 
 // 23.2.2.3 list modifiers [lib.list.modifiers]
 
+// { dg-require-time "" }
+
 #include <list>
 #include <testsuite_hooks.h>
 #include <ext/throw_allocator.h>
index 378583ac83cd1b90d3fd78a04b13f645813dbba3..5e838f324e11aba43495992e83687570a686d0c9 100644 (file)
@@ -24,6 +24,8 @@
 #include <cstring>
 #include <testsuite_hooks.h>
 
+// { dg-require-fileio "" }
+
 // In the occasion of libstdc++/25482
 void test01()
 {
index 682c515683e4c8349b785f97dc725dd839bf9e61..4e815426c3c5207e5a82d351afa643d67c92dd2b 100644 (file)
@@ -23,6 +23,8 @@
 #include <algorithm>
 #include <testsuite_hooks.h>
 
+// { dg-require-fileio "" }
+
 // In the occasion of libstdc++/25482
 void test01()
 {
index dde8086999ace6a1dba27e34174cf88a21b95043..97200a68f7d1fb4e848a037f3d7f711ac9c6b694 100644 (file)
@@ -18,6 +18,8 @@
 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 // USA.
 
+// { dg-require-fileio "" }
+
 #include <fstream>
 #include <testsuite_hooks.h>
 
index 6ad7c47278ea4e42f05ce7361a672db530ea2fa6..4da987b94f8687d7c51ef97db3e54101db617296 100644 (file)
@@ -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 <iostream>
 #include <cstdio>
index 4ce8c673700dc1bd1f13a76e59b5fb5edf854c87..ae6ef0bd6232e3bf2b56d7559013feffe40bf009 100644 (file)
@@ -19,6 +19,8 @@
 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 // USA.
 
+// { dg-require-time "" }
+
 #include <ext/throw_allocator.h>
 #include <testsuite_api.h>
 
index 53a788d5d5528ac7a18df0a8df78e1b9601eaf0e..5eb4549db1bf375f137715f1dbdf1a8554dbd299 100644 (file)
@@ -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();
     }
 
index d82813e729a52f8522d1c048da66ca0572af2b22..91135084c2656ede19acd162a54a2b8e37be163d 100644 (file)
@@ -45,6 +45,8 @@
  * Contains a random-operation test for maps and sets.
  */
 
+// { dg-require-time "" }
+
 #include <regression/rand/assoc/rand_regression_test.hpp>
 #include <regression/assoc/common_type.hpp>
 
index 652774a39aaa2f46a9c00f0c20d551501b77be2f..2c55313f65a3a25d5ae1ca807248403ef7a87b9c 100644 (file)
@@ -45,6 +45,8 @@
  * Contains a random-operation test for maps and sets.
  */
 
+// { dg-require-time "" }
+
 #include <regression/rand/assoc/rand_regression_test.hpp>
 #include <regression/assoc/common_type.hpp>
 
index 98bbf59cf55657761c1e2aa77848c19f55f73c90..6849a02ba37c8ce0f9368df7840b12538ab79779 100644 (file)
@@ -45,6 +45,8 @@
  * Contains a random-operation test for maps and sets.
  */
 
+// { dg-require-time "" }
+
 #include <regression/rand/assoc/rand_regression_test.hpp>
 #include <regression/assoc/common_type.hpp>
 
index 90e0de038c29ff4628e7d686ff7b41b7fa4ac3c6..3320e420407ef61913a088202b10c91692f239b1 100644 (file)
@@ -45,6 +45,8 @@
  * Contains a random-operation test for maps and sets.
  */
 
+// { dg-require-time "" }
+
 #include <regression/rand/assoc/rand_regression_test.hpp>
 #include <regression/assoc/common_type.hpp>
 
index 67e5b6f455a65935bd626023f1cf759cd136578d..3860e66eab9a3fc5b00da40c9acbb34e35163b28 100644 (file)
@@ -45,6 +45,8 @@
  * Contains a random-operation test for priority queues.
  */
 
+// { dg-require-time "" }
+
 #include <regression/rand/priority_queue/rand_regression_test.hpp>
 #include <regression/priority_queue/common_type.hpp>
 
index 645d2eecd056943a1b984704e33670122d7f5e0d..5a2a29ca67ff953abada9ef748502a068c463c8e 100644 (file)
@@ -45,6 +45,8 @@
  * Contains a random-operation test for maps and sets.
  */
 
+// { dg-require-time "" }
+
 #include <regression/rand/assoc/rand_regression_test.hpp>
 #include <regression/assoc/common_type.hpp>
 
index 1e3a3dbe05e67545b0c29a93757dd304bc149bde..22f00c49643bdb97fbbf218f01c86a7a3308904e 100644 (file)
@@ -45,6 +45,8 @@
  * Contains a random-operation test for maps and sets.
  */
 
+// { dg-require-time "" }
+
 #include <regression/rand/assoc/rand_regression_test.hpp>
 #include <regression/assoc/common_type.hpp>
 
index 90e4fc6129f3b4cb8090a8d44327bd9294981d7e..61e72bca99a340762658a9647045f2a20cd42e7b 100644 (file)
@@ -45,6 +45,8 @@
  * Contains a random-operation test for maps and sets.
  */
 
+// { dg-require-time "" }
+
 #include <regression/rand/assoc/rand_regression_test.hpp>
 #include <regression/assoc/common_type.hpp>
 
index cd1991e73c526725a774e90156796df03a61c889..1840ebf39ba1aa61afd7ae596dae459722a0f647 100644 (file)
@@ -45,6 +45,8 @@
  * Contains a random-operation test for maps and sets.
  */
 
+// { dg-require-time "" }
+
 #include <regression/rand/assoc/rand_regression_test.hpp>
 #include <regression/assoc/common_type.hpp>
 
index 902361eff0d71bf1a43c3cbd4748027a5746ebfb..9e5c041f6f5f227f922db9f63d283ee8ccd52e1d 100644 (file)
@@ -17,6 +17,8 @@
 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 // USA.
 
+// { dg-require-time "" }
+
 #include <ext/throw_allocator.h>
 #include <testsuite_allocator.h>
 
index 8e6e1a025aa04a61fa7fddaa1c3d488a05361a9a..c49ed2de1e39fefe881105251cefcdbf8a643b34 100644 (file)
@@ -17,6 +17,8 @@
 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 // USA.
 
+// { dg-require-time "" }
+
 #include <ext/throw_allocator.h>
 #include <testsuite_allocator.h>
 
index a8e716798fef53ae2d2adff392a791216bcd6c34..7dd7b1a2c9c7aa78a34ca44304a3c87e9043085c 100644 (file)
@@ -17,6 +17,8 @@
 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 // USA.
 
+// { dg-require-time "" }
+
 #include <cstdlib>
 #include <ext/throw_allocator.h>
 #include <testsuite_hooks.h>
index 1b00412918f05cc0cf5b7e6b294ba341dcac423b..55c1d2b94835314d2772ff1b3722fa74afdc35ec 100644 (file)
@@ -17,6 +17,8 @@
 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 // USA.
 
+// { dg-require-time "" }
+
 #include <cstdlib>
 #include <ext/throw_allocator.h>
 #include <testsuite_hooks.h>
index c8bbe510c9b44180560409e7c6883e83b5fb4928..1eb90ab28e255140ba04579f254e14afaf96bff0 100644 (file)
@@ -17,6 +17,8 @@
 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 // USA.
 
+// { dg-require-time "" }
+
 #include <string>
 #include <stdexcept>
 #include <ext/throw_allocator.h>
index 794232e914ed95a6ac63f7079bd7e73f7fcc92b4..d6d57e7e95570c106292d720592935fcad0ea949 100644 (file)
@@ -17,6 +17,8 @@
 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 // USA.
 
+// { dg-require-time "" }
+
 #include <string>
 #include <ext/throw_allocator.h>
 #include <testsuite_hooks.h>
index 3d47cd62ee847f80326736c532d5ffa515e4d7d6..823e66ea0d033b3af46ad8a0fdcd79f4d10f452d 100644 (file)
@@ -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 <ctime>
 #include <tr1/random>
 #include <testsuite_hooks.h>
index 7861954a13ffa092e856e18c80b05cfaea579260..5e4075d24fba9d1015356a57363797a53d8345c4 100644 (file)
@@ -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 <ctime>
 #include <tr1/random>
 #include <testsuite_hooks.h>
index 509144563c3a29bf8d9d2e84d44b89a6619792c9..ef583dda3410d65ad05cb49750cef3ba132d85c1 100644 (file)
@@ -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 <ctime>
 #include <tr1/random>
 #include <testsuite_hooks.h>
index 0a95397c51871f23cfc69f0665326c960158402c..d7a894b0870925da8505b250782d03866901f59a 100644 (file)
@@ -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 <ctime>
 #include <tr1/random>
 #include <testsuite_hooks.h>