Remove CheckRegSize from instructions with 0, 1 or fixed operands.
[deliverable/binutils-gdb.git] / gold / testsuite / incremental_test.sh
CommitLineData
325e6408
RÁE
1#!/bin/sh
2
3# incremental_test.sh -- test that incremental linking information is correct.
4
d1238d12 5# Copyright 2009, 2010 Free Software Foundation, Inc.
325e6408 6# Written by Rafael Avila de Espindola <espindola@google.com>
d1238d12 7# and Cary Coutant <ccoutant@google.com>
325e6408
RÁE
8
9# This file is part of gold.
10
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.
15
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.
20
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.
25
d1238d12
CC
26check_cmp()
27{
28 if ! cmp -s "$1" "$2"
29 then
30 echo "Actual output differs from expected:"
31 echo "diff $1 $2"
32 diff $1 $2
33 exit 1
34 fi
35}
325e6408 36
d1238d12
CC
37check()
38{
39 if ! grep -q "$2" "$1"
40 then
41 echo "Did not find expected output in $1:"
42 echo " $2"
43 echo ""
44 echo "Actual output below:"
45 cat "$1"
46 exit 1
47 fi
48}
325e6408 49
d1238d12
CC
50# Extract actual command line from linker's -v output.
51cat incremental_test.cmdline |
52 grep "gcctestdir/ld " |
53 cut -d ' ' -f 2- > actual
325e6408 54
d1238d12
CC
55# Extract recorded command line from dump of the output file.
56cat incremental_test.stdout |
57 grep "Link command line" |
58 cut -d : -f 2- |
59 cut -d ' ' -f 3- |
60 sed "s/'//g" > recorded
61
62# Verify that the command line was recorded correctly.
63check_cmp actual recorded
64
65rm -f actual recorded
66
67# Filter the incremental-dump output into a format that can be grepped
68# more easily.
69
70awk '
71 /^[A-Za-z][A-Za-z ]+:$/ { section = $0; }
72 /^[[]/ { subsection = $0; }
73 /^ / { print section, subsection, $0; }
74' < incremental_test.stdout > incremental_test.dump
75
76check incremental_test.dump "Input sections: .* incremental_test_1.o *1 "
77check incremental_test.dump "Input sections: .* incremental_test_2.o *1 "
78check incremental_test.dump "Global symbol table: .* main .* relocation type "
79check incremental_test.dump "Global symbol table: .* a *incremental_test_1.o "
80check incremental_test.dump "Global symbol table: .* a .* relocation type "
81check incremental_test.dump "Global symbol table: .* b *incremental_test_2.o "
82check incremental_test.dump "Global symbol table: .* b .* relocation type "
83check incremental_test.dump "Global symbol table: .* t1 *incremental_test_2.o "
84check incremental_test.dump "Global symbol table: .* t1 .* relocation type "
85
86rm -f incremental_test.dump
87
88exit 0
This page took 0.06316 seconds and 4 git commands to generate.