Commit | Line | Data |
---|---|---|
3c74c164 AO |
1 | ! Test that .cranges are emitted: |
2 | ! 1) Not for sections with single contents. | |
3 | ! 2) For data (through pseudo-ops) in SHmedia. | |
4 | ! 3) For mixed SHcompact and SHmedia sections. | |
5 | ! 4) For a mix of 2 and 3 | |
6 | ! 5) For 4, repeated. | |
7 | ! | |
8 | ! Use section contents that need relaxing to strengthen the check that the | |
9 | ! .cranges implementation handles this correctly. Use different sizes for | |
10 | ! each contents part. | |
11 | ! | |
12 | ||
13 | ! The .text section has only SHmedia contents, and should not get a | |
14 | ! .cranges descriptor. | |
15 | .mode SHmedia | |
16 | .text | |
17 | nop | |
18 | shmedia: | |
19 | movi 42,r45 | |
20 | movi shmediaend-shmedia,r46 | |
21 | shmediaend: | |
22 | nop | |
23 | ||
24 | ! Likewise the SHcompact section. | |
25 | .mode SHcompact | |
26 | .section .text.compact,"ax" | |
27 | nop | |
28 | shcompact: | |
29 | mov #42,r0 | |
30 | bt shcompactend | |
31 | nop | |
32 | shcompactend: | |
33 | nop | |
34 | ||
35 | ! This section has SHmedia code followed by data. There should be two | |
36 | ! .cranges descriptors. Note that we put the .mode directive *after* the | |
37 | ! section change. It should not matter. | |
38 | .section .text.shmediaanddata,"ax" | |
39 | .mode SHmedia | |
40 | shmedia_data_code: | |
41 | movi 42,r45 | |
42 | movi shmedia_data_code_end-shmedia_data_code,r46 | |
43 | shmedia_data_code_end: | |
44 | .long 0x6ff0fff0 | |
45 | .long shmedia_dataend-shmedia_data_code | |
46 | .long 50 | |
47 | shmedia_dataend: | |
48 | ||
49 | ! This section mixes SHcompact and SHmedia code. There should be two | |
50 | ! .cranges descriptors. | |
51 | .section .text.codemix,"ax" | |
52 | shmedia_compact_code: | |
53 | movi 42,r45 | |
54 | nop | |
55 | nop | |
56 | movi shmedia_compact_code_end-shmedia_compact_code,r46 | |
57 | nop | |
58 | nop | |
59 | shmedia_compact_code_end: | |
60 | .mode SHcompact | |
61 | compact_code: | |
62 | nop | |
63 | compact: | |
64 | mov #40,r0 | |
65 | nop | |
66 | nop | |
67 | bt compactend | |
68 | nop | |
69 | compactend: | |
70 | nop | |
71 | ||
72 | ! This section mixes SHcompact and SHmedia code, and has a constant | |
73 | ! section after the SHmedia code and one after the SHcompact code. There | |
74 | ! should be three or four .cranges descriptors, depending on whether one | |
75 | ! is emitted for the SHcompact constant pool: there's normally one such | |
76 | ! after each SHcompact function. | |
77 | .mode SHmedia | |
78 | .section .text.codemixconst,"ax" | |
79 | nop | |
80 | shmedia_compact_code2: | |
81 | movi 42,r45 | |
82 | nop | |
83 | nop | |
84 | movi shmedia_compact_code_end2-shmedia_compact_code2,r46 | |
85 | nop | |
86 | nop | |
87 | .long 0x6ff0fff0 | |
88 | .long 0x6ff0fff0 | |
89 | .long 0x6ff00000 | |
90 | .long 0xfff0 | |
91 | .long 0x6ff0fff0 | |
92 | .long 0x6ff0fff0 | |
93 | .long 0 | |
94 | mediapoollabel: | |
95 | .long mediapoollabel2-shmedia_compact_code2 | |
96 | mediapoolend: | |
97 | shmedia_compact_code_end2: | |
98 | .mode SHcompact | |
99 | compact_code2: | |
100 | nop | |
101 | compact2: | |
102 | mov #43,r0 | |
103 | nop | |
104 | nop | |
105 | bt compactend2 | |
106 | nop | |
107 | nop | |
108 | nop | |
109 | compactend2: | |
110 | nop | |
a3f9a7e9 | 111 | .space 102,0 |
3c74c164 AO |
112 | .long 0 |
113 | mediapoollabel2: | |
114 | .long mediapoolend2-compact2 | |
115 | mediapoolend2: | |
116 | ||
117 | ! This section is like the previous, but repeated twice and adjusted to | |
118 | ! keep different sizes of each part. | |
119 | .mode SHmedia | |
120 | .section .text.codemixconst2,"ax" | |
121 | nop | |
122 | shmedia_compact_code3: | |
123 | movi 42,r45 | |
124 | nop | |
125 | nop | |
126 | nop | |
127 | nop | |
128 | nop | |
129 | nop | |
130 | movi shmedia_compact_code_end3-shmedia_compact_code3,r46 | |
131 | .long 0x6ff0fff0 | |
132 | .long 0 | |
133 | .long 0 | |
134 | .long 0 | |
135 | .long 0 | |
136 | .long 0 | |
137 | .long 0 | |
138 | .long 0 | |
139 | .long 0 | |
140 | mediapoollabel3a: | |
141 | .long mediapoollabel3a-shmedia_compact_code3 | |
142 | mediapoolend3a: | |
143 | shmedia_compact_code_end3: | |
144 | .mode SHcompact | |
145 | compact_code3: | |
146 | nop | |
147 | compact3: | |
148 | mov #44,r0 | |
149 | nop | |
150 | nop | |
151 | bt compactend3 | |
152 | nop | |
153 | nop | |
154 | nop | |
155 | nop | |
156 | nop | |
157 | compactend3: | |
158 | nop | |
159 | .word 9 | |
160 | .word 0x900 | |
161 | .space 198,0 | |
162 | .long 0 | |
163 | mediapoollabel3: | |
164 | .long mediapoolend3-compact3 | |
165 | mediapoolend3: | |
166 | .mode SHmedia | |
167 | nop | |
168 | shmedia_compact_code4: | |
169 | movi 43,r45 | |
170 | nop | |
171 | nop | |
172 | nop | |
173 | nop | |
174 | nop | |
175 | nop | |
176 | nop | |
177 | nop | |
178 | movi shmedia_compact_code_end4-shmedia_compact_code4,r46 | |
179 | .long 0x6ff0fff0 | |
a3f9a7e9 | 180 | .space 20,0 |
3c74c164 AO |
181 | mediapoollabel4a: |
182 | .long mediapoolend4a-shmedia_compact_code4 | |
183 | mediapoolend4a: | |
184 | shmedia_compact_code_end4: | |
185 | .mode SHcompact | |
186 | compact_code4: | |
187 | nop | |
188 | compact4: | |
189 | mov #14,r0 | |
190 | nop | |
191 | nop | |
192 | bt compactend4 | |
193 | nop | |
194 | nop | |
195 | nop | |
196 | nop | |
197 | nop | |
198 | nop | |
199 | nop | |
200 | nop | |
201 | nop | |
202 | nop | |
203 | nop | |
204 | compactend4: | |
205 | nop | |
a3f9a7e9 | 206 | .space 298,0 |
3c74c164 AO |
207 | .long 0 |
208 | mediapoollabel4: | |
209 | .long mediapoolend4-compact4 | |
210 | mediapoolend4: |