OSDN Git Service

2005-10-24 Jerry DeLisle <jvdelisle@verizon.net>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / testsuite / libstdc++-abi / abi.exp
1 # Copyright (C) 2005 Free Software Foundation, Inc.
2 #
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
7
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  
16
17 # If there is no baseline file, or we can't find the library, skip
18 # this test. Or, hey, if we don't support this kind of symbol
19 # versioning test: don't run it.
20
21 # Build the support objects.
22 v3-build_support
23
24 if { (${v3-symver} == 0) || ![info exists baseline_file] \
25          || ![file exists $baseline_file] \
26          || ![file exists "../src/.libs/libstdc++.so"] } {
27     return
28 }
29
30 # Figure out what symbols are defined by the active build of the library.
31 remote_exec "build" "$srcdir/../scripts/extract_symvers" \
32     [list "../src/.libs/libstdc++.so" "current_symbols.txt"]
33
34 # Build the abi_check program.
35 if { [v3_target_compile "$srcdir/testsuite_abi_check.cc" "abi_check" \
36       "executable" [list "additional_flags=-w"]] != "" } {
37     error "could not compile testsuite_abi_check.cc"
38 }
39
40 remote_download "target" $baseline_file "baseline_symbols.txt"
41 remote_download "target" "current_symbols.txt" "current_symbols.txt"
42 set result [${tool}_load "./abi_check" \
43                 [list "--check-verbose" "current_symbols.txt" \
44                      "baseline_symbols.txt"]]
45 [lindex $result 0] "abi_check"