Add 2 tests for PR ld/11812.
[binutils.git] / gold / testsuite / memory_test.sh
blob5c172f4957b650bb5cded928b772de44c970778b
1 #!/bin/sh
3 # memory_test.sh -- test MEMORY regions.
5 # Copyright 2010 Free Software Foundation, Inc.
6 # Written by Nick Clifton <nickc@redhat.com>
8 # This file is part of gold.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 3 of the License, or
13 # (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
23 # MA 02110-1301, USA.
26 check()
28 file=$1
29 pattern=$2
30 found=`grep "$pattern" $file`
31 if test -z "$found"; then
32 echo "pattern \"$pattern\" not found in file $file."
33 echo $found
34 exit 1
38 check memory_test.stdout \
39 " LOAD 0x001000 0x0*00000000 0x0*00000000 0x00000\?2 0x00000\?2 R 0x1000"
40 check memory_test.stdout \
41 " LOAD 0x00112c 0x0*00001000 0x0*0000012c 0x00000\?2 0x00000\?2 R 0x1000"
42 check memory_test.stdout \
43 " LOAD 0x002000 0x0*00005000 0x0*00005000 0x00000\?2 0x00000\?2 R 0x1000"
44 check memory_test.stdout \
45 " LOAD 0x00203c 0x0*00004000 0x0*0000603c 0x00000\?2 0x00000\?2 R 0x1000"
48 exit 0