OSDN Git Service

2010-10-26 Paolo Carlini <paolo.carlini@oracle.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Oct 2010 10:22:43 +0000 (10:22 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Oct 2010 10:22:43 +0000 (10:22 +0000)
* testsuite/lib/libstdc++.exp ([check_v3_target_normal_mode]): Add.
* testsuite/lib/dg-options.exp ([dg-require-normal-mode]): Likewise.
* testsuite/23_containers/headers/forward_list/synopsis.cc: Use the
latter.
* testsuite/23_containers/headers/vector/synopsis.cc: Likewise.
* testsuite/23_containers/headers/deque/synopsis.cc: Likewise.
* testsuite/23_containers/headers/bitset/synopsis.cc: Likewise.
* testsuite/23_containers/headers/list/synopsis.cc: Likewise.
* testsuite/23_containers/headers/set/synopsis.cc: Likewise.
* testsuite/23_containers/headers/map/synopsis.cc: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165937 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/23_containers/headers/bitset/synopsis.cc
libstdc++-v3/testsuite/23_containers/headers/deque/synopsis.cc
libstdc++-v3/testsuite/23_containers/headers/forward_list/synopsis.cc
libstdc++-v3/testsuite/23_containers/headers/list/synopsis.cc
libstdc++-v3/testsuite/23_containers/headers/map/synopsis.cc
libstdc++-v3/testsuite/23_containers/headers/set/synopsis.cc
libstdc++-v3/testsuite/23_containers/headers/vector/synopsis.cc
libstdc++-v3/testsuite/lib/dg-options.exp
libstdc++-v3/testsuite/lib/libstdc++.exp

index ce0944e..14e0b9f 100644 (file)
@@ -1,3 +1,16 @@
+2010-10-26  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * testsuite/lib/libstdc++.exp ([check_v3_target_normal_mode]): Add.
+       * testsuite/lib/dg-options.exp ([dg-require-normal-mode]): Likewise.
+       * testsuite/23_containers/headers/forward_list/synopsis.cc: Use the
+       latter.
+       * testsuite/23_containers/headers/vector/synopsis.cc: Likewise.
+       * testsuite/23_containers/headers/deque/synopsis.cc: Likewise.
+       * testsuite/23_containers/headers/bitset/synopsis.cc: Likewise.
+       * testsuite/23_containers/headers/list/synopsis.cc: Likewise.
+       * testsuite/23_containers/headers/set/synopsis.cc: Likewise.
+       * testsuite/23_containers/headers/map/synopsis.cc: Likewise.
+
 2010-10-25  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * include/bits/forward_list.h (_Fwd_list_node_base::swap): Remove.
index 385ce62..0eccdf4 100644 (file)
@@ -1,6 +1,7 @@
 // { dg-do compile }
+// { dg-require-normal-mode "" }
 
-// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index de75335..137ed61 100644 (file)
@@ -1,6 +1,7 @@
 // { dg-do compile }
+// { dg-require-normal-mode "" }
 
-// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 21d80cb..73cd9c5 100644 (file)
@@ -1,7 +1,8 @@
 // { dg-do compile }
+// { dg-require-normal-mode "" }
 // { dg-options "-std=gnu++0x" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -24,22 +25,28 @@ namespace std {
   template <class T, class Allocator> class forward_list;
 
   template <class T, class Allocator>
-  bool operator==(const forward_list<T,Allocator>& x, const forward_list<T,Allocator>&);
+  bool operator==(const forward_list<T,Allocator>& x,
+                 const forward_list<T,Allocator>&);
 
   template <class T, class Allocator>
-  bool operator< (const forward_list<T,Allocator>& x, const forward_list<T,Allocator>&);
+  bool operator< (const forward_list<T,Allocator>& x,
+                 const forward_list<T,Allocator>&);
 
   template <class T, class Allocator>
-    bool operator!=(const forward_list<T,Allocator>& x, const forward_list<T,Allocator>&);
+    bool operator!=(const forward_list<T,Allocator>& x,
+                   const forward_list<T,Allocator>&);
 
   template <class T, class Allocator>
-    bool operator> (const forward_list<T,Allocator>& x, const forward_list<T,Allocator>&);
+    bool operator> (const forward_list<T,Allocator>& x,
+                   const forward_list<T,Allocator>&);
 
   template <class T, class Allocator>
-    bool operator>=(const forward_list<T,Allocator>& x, const forward_list<T,Allocator>&);
+    bool operator>=(const forward_list<T,Allocator>& x,
+                   const forward_list<T,Allocator>&);
 
   template <class T, class Allocator>
-    bool operator<=(const forward_list<T,Allocator>& x, const forward_list<T,Allocator>&);
+    bool operator<=(const forward_list<T,Allocator>& x,
+                   const forward_list<T,Allocator>&);
 
   template <class T, class Allocator>
     void swap(forward_list<T,Allocator>& x, forward_list<T,Allocator>& y);
index 02dd918..7d44c7c 100644 (file)
@@ -1,6 +1,7 @@
 // { dg-do compile }
+// { dg-require-normal-mode "" }
 
-// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 29160ba..0fc977c 100644 (file)
@@ -1,6 +1,7 @@
 // { dg-do compile }
+// { dg-require-normal-mode "" }
 
-// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 283880e..94ae348 100644 (file)
@@ -1,6 +1,7 @@
 // { dg-do compile }
+// { dg-require-normal-mode "" }
 
-// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 9178c7b..e543e8f 100644 (file)
@@ -1,6 +1,7 @@
 // { dg-do compile }
+// { dg-require-normal-mode "" }
 
-// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 2fefb77..e8d7f34 100644 (file)
@@ -35,6 +35,15 @@ proc dg-require-debug-mode { args } {
     return
 }
 
+proc dg-require-normal-mode { args } {
+    if { ![ check_v3_target_normal_mode ] } {
+       upvar dg-do-what dg-do-what
+       set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
+       return
+    }
+    return
+}
+
 proc dg-require-parallel-mode { args } {
     if { ![ check_v3_target_parallel_mode ] } {
        upvar dg-do-what dg-do-what
index a0279a5..65ffa66 100644 (file)
@@ -922,7 +922,6 @@ proc check_v3_target_debug_mode { } {
        set exe debug_mode[pid].exe
 
        set f [open $src "w"]
-       puts $f "#include <string>"
        puts $f "#ifndef _GLIBCXX_DEBUG"
        puts $f "#  error No debug mode"
        puts $f "#endif"
@@ -942,6 +941,55 @@ proc check_v3_target_debug_mode { } {
     return $et_debug_mode
 }
 
+proc check_v3_target_normal_mode { } {
+    global et_normal_mode
+    global tool        
+
+    if { ![info exists et_normal_mode_target_name] } {
+       set et_normal_mode_target_name ""
+    }
+
+    # If the target has changed since we set the cached value, clear it.
+    set current_target [current_target_name]
+    if { $current_target != $et_normal_mode_target_name } {
+       verbose "check_v3_target_normal_mode: `$et_normal_mode_target_name'" 2
+       set et_normal_mode_target_name $current_target
+       if [info exists et_normal_mode] {
+           verbose "check_v3_target_normal_mode: removing cached result" 2
+           unset et_normal_mode
+       }
+    }
+
+    if [info exists et_normal_mode] {
+       verbose "check_v3_target_normal_mode: using cached result" 2
+    } else {
+       set et_normal_mode 0
+
+       # Set up and compile a C++ test program that depends
+       # on normal mode activated.
+       set src normal_mode[pid].cc
+       set exe normal_mode[pid].exe
+
+       set f [open $src "w"]
+       puts $f "#if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PROFILE) || defined(_GLIBCXX_PARALLEL)"
+       puts $f "#  error No normal mode"
+       puts $f "#endif"
+       puts $f "int main()"
+       puts $f "{ return 0; }"
+       close $f
+
+       set lines [v3_target_compile $src $exe executable ""]
+       file delete $src
+
+       if [string match "" $lines] {
+           # No error message, compilation succeeded.
+           set et_normal_mode 1
+       }
+    }
+    verbose "check_v3_target_normal_mode: $et_normal_mode" 2
+    return $et_normal_mode
+}
+
 proc check_v3_target_parallel_mode { } {
     global cxxflags
     global v3-libgomp