Commit | Line | Data |
---|---|---|
7f8cd844 NC |
1 | #!/bin/sh |
2 | ||
3 | # memory_test.sh -- test MEMORY regions. | |
4 | ||
5 | # Copyright 2010 Free Software Foundation, Inc. | |
6 | # Written by Nick Clifton <nickc@redhat.com> | |
7 | ||
8 | # This file is part of gold. | |
9 | ||
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. | |
14 | ||
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. | |
19 | ||
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. | |
24 | ||
25 | ||
26 | check() | |
27 | { | |
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 | |
35 | fi | |
36 | } | |
37 | ||
38 | check memory_test.stdout \ | |
41a8542a | 39 | " LOAD 0x001000 0x0*00000000 0x0*00000000 0x00000\?2 0x00000\?2 R 0x1000" |
7f8cd844 | 40 | check memory_test.stdout \ |
41a8542a | 41 | " LOAD 0x00112c 0x0*00001000 0x0*0000012c 0x00000\?2 0x00000\?2 R 0x1000" |
7f8cd844 | 42 | check memory_test.stdout \ |
41a8542a | 43 | " LOAD 0x002000 0x0*00005000 0x0*00005000 0x00000\?2 0x00000\?2 R 0x1000" |
7f8cd844 | 44 | check memory_test.stdout \ |
2904037a | 45 | " LOAD 0x00203c 0x0*00004000 0x0*0000603c 0x00000\?2 0x00000\?2 R 0x1000" |
7f8cd844 NC |
46 | |
47 | ||
48 | exit 0 |