3 # arm_branch_out_of_range.sh -- test ARM/THUMB/THUMB branch instructions whose
4 # targets are just out of the branch range limits.
6 # Copyright (C) 2010-2024 Free Software Foundation, Inc.
7 # Written by Doug Kwan <dougkwan@google.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,
26 # This file goes with the assembler source files arm_bl_out_of_range.s,
27 # thumb_bl_out_of_range.s and thumb_bl_out_of_range_local.s that are assembled
28 # and linked to check that branches whose target are just out of the branch
29 # range limits are handle correctly.
36 found
=`grep "$pattern" $file`
37 if test -z "$found"; then
38 echo "pattern \"$pattern\" not found in file $file."
43 # This is a bit crude. Also, there are tabs in the grep patterns.
45 check arm_bl_out_of_range.stdout \
46 " 4000004: eb00003d bl 4000100 <.*>"
47 check arm_bl_out_of_range.stdout \
48 " 4000008: eb00003e bl 4000108 <.*>"
49 check arm_bl_out_of_range.stdout \
50 " 4000100: e51ff004 ldr pc, \[pc, #-4\]"
51 check arm_bl_out_of_range.stdout \
53 check arm_bl_out_of_range.stdout \
54 " 4000108: e51ff004 ldr pc, \[pc, #-4\]"
55 check arm_bl_out_of_range.stdout \
58 check thumb_bl_out_of_range.stdout \
59 " 800004: f000 e87c blx 800100 <.*>"
60 check thumb_bl_out_of_range.stdout \
61 " 800008: f000 e87e blx 800108 <.*>"
62 check thumb_bl_out_of_range.stdout \
63 " 800100: e51ff004 ldr pc, \[pc, #-4\]"
64 check thumb_bl_out_of_range.stdout \
66 check thumb_bl_out_of_range.stdout \
67 " 800108: e51ff004 ldr pc, \[pc, #-4\]"
68 check thumb_bl_out_of_range.stdout \
71 check thumb_blx_out_of_range.stdout \
72 " 800004: f000 e87c blx 800100 <.*>"
73 check thumb_blx_out_of_range.stdout \
74 " 80000a: f000 e87e blx 800108 <.*>"
75 check thumb_blx_out_of_range.stdout \
76 " 800100: e51ff004 ldr pc, \[pc, #-4\]"
77 check thumb_blx_out_of_range.stdout \
79 check thumb_blx_out_of_range.stdout \
80 " 800108: e51ff004 ldr pc, \[pc, #-4\]"
81 check thumb_blx_out_of_range.stdout \
84 check thumb_bl_out_of_range_local.stdout \
85 " 800004: f000 e87c blx 800100 <.*>"
86 check thumb_bl_out_of_range_local.stdout \
87 " 800008: f000 e87e blx 800108 <.*>"
88 check thumb_bl_out_of_range_local.stdout \
89 " 800100: e51ff004 ldr pc, \[pc, #-4\]"
90 check thumb_bl_out_of_range_local.stdout \
92 check thumb_bl_out_of_range_local.stdout \
93 " 800108: e51ff004 ldr pc, \[pc, #-4\]"
94 check thumb_bl_out_of_range_local.stdout \
97 check thumb2_bl_out_of_range.stdout \
98 " 2000004: f000 e87c blx 2000100 <.*>"
99 check thumb2_bl_out_of_range.stdout \
100 " 2000008: f000 e87e blx 2000108 <.*>"
101 check thumb2_bl_out_of_range.stdout \
102 " 2000100: e51ff004 ldr pc, \[pc, #-4\]"
103 check thumb2_bl_out_of_range.stdout \
104 " 2000104: 01000007 "
105 check thumb2_bl_out_of_range.stdout \
106 " 2000108: e51ff004 ldr pc, \[pc, #-4\]"
107 check thumb2_bl_out_of_range.stdout \
108 " 200010c: 0300000d "
110 check thumb2_blx_out_of_range.stdout \
111 " 2000004: f000 e87c blx 2000100 <.*>"
112 check thumb2_blx_out_of_range.stdout \
113 " 200000a: f000 e87e blx 2000108 <.*>"
114 check thumb2_blx_out_of_range.stdout \
115 " 2000100: e51ff004 ldr pc, \[pc, #-4\]"
116 check thumb2_blx_out_of_range.stdout \
117 " 2000104: 01000004 "
118 check thumb2_blx_out_of_range.stdout \
119 " 2000108: e51ff004 ldr pc, \[pc, #-4\]"
120 check thumb2_blx_out_of_range.stdout \
121 " 200010c: 0300000c "