ld: Update function prototypes for compilers defaulting to -std=gnu23
[binutils-gdb.git] / ld / testsuite / ld-elf / wrap.exp
blobd855aa7dae5b428f6c3749694fbf72d5417e39a9
1 # Expect script for wrap ELF tests.
2 # Copyright (C) 2006-2025 Free Software Foundation, Inc.
4 # This file is part of the GNU Binutils.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 # MA 02110-1301, USA.
22 # Exclude non-ELF targets.
24 if ![is_elf_format] {
25 return
28 # Check if compiler works
29 if { ![check_compiler_available] } {
30 return
33 if [check_shared_lib_support] {
34 set build_tests {
35 {"Build libwrap1a.so"
36 "-shared" "-fPIC"
37 {wrap1a.c} {} "libwrap1a.so"}
38 {"Build libwrap1b.so"
39 "-shared tmpdir/libwrap1a.so" "-fPIC"
40 {wrap1b.c} {} "libwrap1b.so"}
43 set run_tests {
44 {"Run with libwrap1a.so and libwrap1b.so"
45 "-Wl,--no-as-needed,--wrap,par tmpdir/libwrap1a.so tmpdir/libwrap1b.so" ""
46 {wrap1.c} "wrap1" "wrap1.out"}
47 {"Run with libwrap1b.so and libwrap1a.so"
48 "-Wl,--no-as-needed,--wrap,par tmpdir/libwrap1b.so tmpdir/libwrap1a.so" ""
49 {wrap1.c} "wrap1" "wrap1.out"}
52 run_cc_link_tests $build_tests
53 run_ld_link_exec_tests $run_tests
56 run_ld_link_tests [list \
57 [list \
58 "Build libwrap2.a" \
59 "" \
60 "" \
61 "" \
62 {wrap2a.c} \
63 {} \
64 "libwrap2.a" \
65 "-g" \
66 ] \
69 # Test very simple native Linux/x86 programs with linux-x86.S.
70 run_ld_link_exec_tests [list \
71 [list \
72 "Run wrap2" \
73 "-Wl,--wrap=impl" \
74 "" \
75 { wrap2b.c } \
76 "wrap2" \
77 "pass.out" \
78 "-g" \
79 ] \