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
18shmedia:
19	movi 42,r45
20	movi shmediaend-shmedia,r46
21shmediaend:
22	nop
23
24! Likewise the SHcompact section.
25	.mode SHcompact
26	.section .text.compact,"ax"
27	nop
28shcompact:
29	mov #42,r0
30	bt shcompactend
31	nop
32shcompactend:
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
40shmedia_data_code:
41	movi 42,r45
42	movi shmedia_data_code_end-shmedia_data_code,r46
43shmedia_data_code_end:
44	.long 0x6ff0fff0
45	.long shmedia_dataend-shmedia_data_code
46	.long 50
47shmedia_dataend:
48
49! This section mixes SHcompact and SHmedia code.  There should be two
50! .cranges descriptors.
51	.section .text.codemix,"ax"
52shmedia_compact_code:
53	movi 42,r45
54	nop
55	nop
56	movi shmedia_compact_code_end-shmedia_compact_code,r46
57	nop
58	nop
59shmedia_compact_code_end:
60	.mode SHcompact
61compact_code:
62	nop
63compact:
64	mov #40,r0
65	nop
66	nop
67	bt compactend
68	nop
69compactend:
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
80shmedia_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
94mediapoollabel:
95	.long mediapoollabel2-shmedia_compact_code2
96mediapoolend:
97shmedia_compact_code_end2:
98	.mode SHcompact
99compact_code2:
100	nop
101compact2:
102	mov #43,r0
103	nop
104	nop
105	bt compactend2
106	nop
107	nop
108	nop
109compactend2:
110	nop
111	.space 102,0
112	.long 0
113mediapoollabel2:
114	.long mediapoolend2-compact2
115mediapoolend2:
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
122shmedia_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
140mediapoollabel3a:
141	.long mediapoollabel3a-shmedia_compact_code3
142mediapoolend3a:
143shmedia_compact_code_end3:
144	.mode SHcompact
145compact_code3:
146	nop
147compact3:
148	mov #44,r0
149	nop
150	nop
151	bt compactend3
152	nop
153	nop
154	nop
155	nop
156	nop
157compactend3:
158	nop
159	.word 9
160	.word 0x900
161	.space 198,0
162	.long 0
163mediapoollabel3:
164	.long mediapoolend3-compact3
165mediapoolend3:
166	.mode SHmedia
167	nop
168shmedia_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
180	.space 20,0
181mediapoollabel4a:
182	.long mediapoolend4a-shmedia_compact_code4
183mediapoolend4a:
184shmedia_compact_code_end4:
185	.mode SHcompact
186compact_code4:
187	nop
188compact4:
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
204compactend4:
205	nop
206	.space 298,0
207	.long 0
208mediapoollabel4:
209	.long mediapoolend4-compact4
210mediapoolend4:
211