[PATCH 3/57][Arm][GAS] Add support for MVE instructions: vabs and vneg
[binutils-gdb.git] / gold / testsuite / weak_as_needed.sh
blob1826d1f35476e7a4f66124293a5e8897eedcf0b0
1 #!/bin/sh
3 # weak_as_needed.sh -- a test case for version handling with weak symbols
4 # and --as-needed libraries.
6 # Copyright (C) 2018-2019 Free Software Foundation, Inc.
7 # Written by Cary Coutant <ccoutant@gmail.com>.
9 # This file is part of gold.
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 3 of the License, or
14 # (at your option) any later version.
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
24 # MA 02110-1301, USA.
26 # This test verifies that a weak reference is properly bound to
27 # an as-needed library, when it is first resolved to a symbol in
28 # a library that ends up being not needed.
30 # Ref: https://stackoverflow.com/questions/50751421/undefined-behavior-in-shared-lib-using-libpthread-but-not-having-it-in-elf-as-d
32 check()
34 if ! grep -q "$2" "$1"
35 then
36 echo "Did not find expected output in $1:"
37 echo " $2"
38 echo ""
39 echo "Actual output below:"
40 cat "$1"
41 exit 1
45 check_missing()
47 if grep -q "$2" "$1"
48 then
49 echo "Found unexpected output in $1:"
50 echo " $2"
51 echo ""
52 echo "Actual output below:"
53 cat "$1"
54 exit 1
58 check weak_as_needed.stdout "WEAK .* UND *bar@v2"
59 check weak_as_needed.stdout "NEEDED.*weak_as_needed_c\.so"
60 check_missing weak_as_needed.stdout "NEEDED.*weak_as_needed_b\.so"
62 exit 0