f6f5a80853f662f5db51a184e3e28cbd324d90f4
[external/binutils.git] / ld / testsuite / ld-elf / linux-x86.exp
1 # Expect script for simple native Linux/x86 tests.
2 #   Copyright (C) 2018 Free Software Foundation, Inc.
3 #
4 # This file is part of the GNU Binutils.
5 #
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.
10 #
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.
15 #
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.
20 #
21
22 # Test very simple native Linux/x86 programs with linux-x86.S.
23 if { ![isnative] || [which $CC] == 0 \
24      || (![istarget "i?86-*-linux*"] \
25          && ![istarget "x86_64-*-linux*"] \
26          && ![istarget "amd64-*-linux*"]) } {
27     return
28 }
29
30 # Add $PLT_CFLAGS if PLT is expected.
31 global PLT_CFLAGS
32 # Add $NOPIE_CFLAGS and $NOPIE_LDFLAGS if non-PIE is required.
33 global NOPIE_CFLAGS NOPIE_LDFLAGS
34
35 run_ld_link_exec_tests [list \
36     [list \
37         "Run PR ld/23428 test" \
38         "--no-dynamic-linker -z separate-code" \
39         "" \
40         { linux-x86.S pr23428.c dummy.s } \
41         "pr23428" \
42         "pass.out" \
43         "$NOPIE_CFLAGS -fno-asynchronous-unwind-tables" \
44         "asm" \
45     ] \
46 ]