1 # Copyright (C) 1999, 2000 Free Software Foundation, Inc.
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.
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.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 # Please email any bugs, comments, and/or additions to this file to:
18 # jlarmour@cygnus.co.uk
20 # This file was written by Jonathan Larmour (jlarmour@cygnus.co.uk).
22 # GCC testsuite that uses the `dg.exp' driver.
27 ###############################
28 # proc gcc_target_object_format {}
29 ###############################
30 # has been moved to: gcc/testsuite/lib/file-format.exp
32 ###############################
33 # proc check_weak_available { }
34 ###############################
35 # has been moved to: gcc/testsuite/lib/target-supports.exp
41 if { [ check_weak_available ] == 1 } {
44 set lines [gcc_target_compile "$srcdir/$subdir/weak-1a.c" "weak-1a.o" object ""]
45 if ![string match "" $lines] then {
48 dg-runtest "$srcdir/$subdir/weak-1.c" "weak-1a.o" ""
52 } elseif { [ check_weak_available ] == 0 } {
53 unsupported "weak-1.c"
62 if { [ check_weak_available ] == 1 } {
65 set lines [gcc_target_compile "$srcdir/$subdir/weak-2a.c" "weak-2a.o" object ""]
66 if ![string match "" $lines] then {
69 set lines [gcc_target_compile "$srcdir/$subdir/weak-2b.c" "weak-2b.o" object ""]
70 if ![string match "" $lines] then {
73 dg-runtest "$srcdir/$subdir/weak-2.c" "weak-2a.o weak-2b.o" ""
74 file delete weak-2a.o weak-2b.o
78 } elseif { [ check_weak_available ] == 0 } {
79 unsupported "weak-2.c"
89 switch [check_alias_available "$srcdir/$subdir/alias-1.c"] {
90 yes { dg-runtest "$srcdir/$subdir/alias-1.c" "" "" }
91 no { unsupported "alias-1.c" }
92 default { fail "alias-1.c" }
101 switch [check_alias_available "$srcdir/$subdir/wkali-1.c"] {
102 yes { dg-runtest "$srcdir/$subdir/wkali-1.c" "" "" }
103 no { unsupported "wkali-1.c" }
104 default { fail "wkali-1.c" }
112 if { [ check_weak_available ] == 1 } {
114 set lines [gcc_target_compile "$srcdir/$subdir/wkali-2a.c" "wkali-2a.o" object ""]
115 if ![string match "" $lines] then {
118 set lines [gcc_target_compile "$srcdir/$subdir/wkali-2b.c" "wkali-2b.o" object ""]
119 if ![string match "" $lines] then {
122 dg-runtest "$srcdir/$subdir/wkali-2.c" "wkali-2a.o wkali-2b.o" ""
123 file delete wkali-2a.o wkali-2b.o
127 } elseif { [ check_weak_available ] == 0 } {
128 unsupported "wkali-2.c"
130 unresolved "wkali-2.c"
137 set ld_output [ remote_exec host "[ find_ld ]" "--help" ]
139 if { [ string first "--gc-sections" $ld_output ] >= 0 } {
143 dg-runtest "$srcdir/$subdir/gcsec-1.c" "-ffunction-sections -fdata-sections -Wl,--gc-sections -static" ""
145 dg-runtest "$srcdir/$subdir/gcsec-1.c" "-ffunction-sections -fdata-sections -Wl,--gc-sections" ""
149 unsupported "gcsec-1.c"