* script-sections.cc(class Memory_region): Remove
[binutils.git] / gold / testsuite / memory_test.sh
blobdb3917a7ca975b2d838197c749019e2cb457663f
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 # NOTE: The linker script used in this test (memory_test.t)
27 # should be the same as the one used in the rgn-at5 linker
28 # test (ld/testsuite/ld-scripts/rgn-at5.t).
30 # Modulo some section ordering the output from GOLD in this
31 # test should be the same as the output from GNU LD in the
32 # rgn-at5 test.
34 check()
36 file=$1
37 pattern=$2
38 found=`grep "$pattern" $file`
39 if test -z "$found"; then
40 echo "pattern \"$pattern\" not found in file $file."
41 echo $found
42 exit 1
46 check memory_test.stdout \
47 " LOAD 0x001000 0x0*02000 0x0*02000 0x0*04 0x0*04 R 0x1000"
48 check memory_test.stdout \
49 " LOAD 0x001004 0x0*01000 0x0*02004 0x0*04 0x0*04 R 0x1000"
50 check memory_test.stdout \
51 " LOAD 0x001008 0x0*02008 0x0*02008 0x0*08 0x0*08 R 0x1000"
52 check memory_test.stdout \
53 " LOAD 0x002000 0x0*05000 0x0*05000 0x0*04 0x0*04 R 0x1000"
54 check memory_test.stdout \
55 " LOAD 0x00203c 0x0*04000 0x0*0603c 0x0*04 0x0*04 R 0x1000"
57 exit 0