diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2010-10-26 10:22:43 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2010-10-26 10:22:43 +0000 |
commit | 98fff892cc285ce4fc076153ef8a601df70459ff (patch) | |
tree | f34298658620ce66747de1460b763c821a92a680 | |
parent | 6739e9ec6e06c73b2426e7a8bbcc6594eda40f7f (diff) | |
download | gcc-98fff892cc285ce4fc076153ef8a601df70459ff.zip gcc-98fff892cc285ce4fc076153ef8a601df70459ff.tar.gz gcc-98fff892cc285ce4fc076153ef8a601df70459ff.tar.bz2 |
libstdc++.exp ([check_v3_target_normal_mode]): Add.
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.
From-SVN: r165937
10 files changed, 97 insertions, 14 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ce0944e..14e0b9f 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -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. diff --git a/libstdc++-v3/testsuite/23_containers/headers/bitset/synopsis.cc b/libstdc++-v3/testsuite/23_containers/headers/bitset/synopsis.cc index 385ce62..0eccdf4 100644 --- a/libstdc++-v3/testsuite/23_containers/headers/bitset/synopsis.cc +++ b/libstdc++-v3/testsuite/23_containers/headers/bitset/synopsis.cc @@ -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 diff --git a/libstdc++-v3/testsuite/23_containers/headers/deque/synopsis.cc b/libstdc++-v3/testsuite/23_containers/headers/deque/synopsis.cc index de75335..137ed61 100644 --- a/libstdc++-v3/testsuite/23_containers/headers/deque/synopsis.cc +++ b/libstdc++-v3/testsuite/23_containers/headers/deque/synopsis.cc @@ -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 diff --git a/libstdc++-v3/testsuite/23_containers/headers/forward_list/synopsis.cc b/libstdc++-v3/testsuite/23_containers/headers/forward_list/synopsis.cc index 21d80cb..73cd9c5 100644 --- a/libstdc++-v3/testsuite/23_containers/headers/forward_list/synopsis.cc +++ b/libstdc++-v3/testsuite/23_containers/headers/forward_list/synopsis.cc @@ -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); diff --git a/libstdc++-v3/testsuite/23_containers/headers/list/synopsis.cc b/libstdc++-v3/testsuite/23_containers/headers/list/synopsis.cc index 02dd918..7d44c7c 100644 --- a/libstdc++-v3/testsuite/23_containers/headers/list/synopsis.cc +++ b/libstdc++-v3/testsuite/23_containers/headers/list/synopsis.cc @@ -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 diff --git a/libstdc++-v3/testsuite/23_containers/headers/map/synopsis.cc b/libstdc++-v3/testsuite/23_containers/headers/map/synopsis.cc index 29160ba..0fc977c 100644 --- a/libstdc++-v3/testsuite/23_containers/headers/map/synopsis.cc +++ b/libstdc++-v3/testsuite/23_containers/headers/map/synopsis.cc @@ -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 diff --git a/libstdc++-v3/testsuite/23_containers/headers/set/synopsis.cc b/libstdc++-v3/testsuite/23_containers/headers/set/synopsis.cc index 283880e..94ae348 100644 --- a/libstdc++-v3/testsuite/23_containers/headers/set/synopsis.cc +++ b/libstdc++-v3/testsuite/23_containers/headers/set/synopsis.cc @@ -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 diff --git a/libstdc++-v3/testsuite/23_containers/headers/vector/synopsis.cc b/libstdc++-v3/testsuite/23_containers/headers/vector/synopsis.cc index 9178c7b..e543e8f 100644 --- a/libstdc++-v3/testsuite/23_containers/headers/vector/synopsis.cc +++ b/libstdc++-v3/testsuite/23_containers/headers/vector/synopsis.cc @@ -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 diff --git a/libstdc++-v3/testsuite/lib/dg-options.exp b/libstdc++-v3/testsuite/lib/dg-options.exp index 2fefb77..e8d7f34 100644 --- a/libstdc++-v3/testsuite/lib/dg-options.exp +++ b/libstdc++-v3/testsuite/lib/dg-options.exp @@ -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 diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp index a0279a5..65ffa66 100644 --- a/libstdc++-v3/testsuite/lib/libstdc++.exp +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp @@ -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 |