1@ RUN: llvm-mc -triple armv6t2-linux-eabi -filetype asm -o - %s 2>&1 \
2@ RUN:   | FileCheck %s
3@ RUN: not llvm-mc -triple armv6t2-linux-eabi --fatal-warnings -filetype asm -o - %s 2>&1 \
4@ RUN:   | FileCheck -check-prefix CHECK-ERROR %s
5
6@ RUN: not llvm-mc -triple armv7-linux-eabi -filetype asm -o - %s 2>&1 \
7@ RUN:   | FileCheck %s -check-prefix CHECK -check-prefix CHECK-V7
8
9	.syntax unified
10	.arm
11
12	.global stm
13	.type stm,%function
14stm:
15	stm sp!, {r0, pc}
16@ CHECK: warning: use of SP or PC in the list is deprecated
17@ CHECK-ERROR: error: use of SP or PC in the list is deprecated
18@ CHECK: stm sp!, {r0, pc}
19@ CHECK: ^
20	stm r0!, {r0, sp}
21@ CHECK: warning: use of SP or PC in the list is deprecated
22@ CHECK-ERROR: error: use of SP or PC in the list is deprecated
23@ CHECK: stm r0!, {r0, sp}
24@ CHECK: ^
25	stm r1!, {r0, sp, pc}
26@ CHECK: warning: use of SP or PC in the list is deprecated
27@ CHECK: stm r1!, {r0, sp, pc}
28@ CHECK: ^
29	stm r2!, {sp, pc}
30@ CHECK: warning: use of SP or PC in the list is deprecated
31@ CHECK: stm r2!, {sp, pc}
32@ CHECK: ^
33	stm sp!, {pc}
34@ CHECK: warning: use of SP or PC in the list is deprecated
35@ CHECK: stm sp!, {pc}
36@ CHECK: ^
37	stm r0!, {sp}
38@ CHECK: warning: use of SP or PC in the list is deprecated
39@ CHECK: stm r0!, {sp}
40@ CHECK: ^
41
42	.global stmda
43	.type stmda,%function
44stmda:
45	stmda sp!, {r0, pc}
46@ CHECK: warning: use of SP or PC in the list is deprecated
47@ CHECK: stmda sp!, {r0, pc}
48@ CHECK: ^
49	stmda r0!, {r0, sp}
50@ CHECK: warning: use of SP or PC in the list is deprecated
51@ CHECK: stmda r0!, {r0, sp}
52@ CHECK: ^
53	stmda r1!, {r0, sp, pc}
54@ CHECK: warning: use of SP or PC in the list is deprecated
55@ CHECK: stmda r1!, {r0, sp, pc}
56@ CHECK: ^
57	stmda r2!, {sp, pc}
58@ CHECK: warning: use of SP or PC in the list is deprecated
59@ CHECK: stmda r2!, {sp, pc}
60@ CHECK: ^
61	stmda sp!, {pc}
62@ CHECK: warning: use of SP or PC in the list is deprecated
63@ CHECK: stmda sp!, {pc}
64@ CHECK: ^
65	stmda r0!, {sp}
66@ CHECK: warning: use of SP or PC in the list is deprecated
67@ CHECK: stmda r0!, {sp}
68@ CHECK: ^
69
70	.global stmdb
71	.type stmdb,%function
72stmdb:
73	stmdb sp!, {r0, pc}
74@ CHECK: warning: use of SP or PC in the list is deprecated
75@ CHECK: stmdb sp!, {r0, pc}
76@ CHECK: ^
77	stmdb r0!, {r0, sp}
78@ CHECK: warning: use of SP or PC in the list is deprecated
79@ CHECK: stmdb r0!, {r0, sp}
80@ CHECK: ^
81	stmdb r1!, {r0, sp, pc}
82@ CHECK: warning: use of SP or PC in the list is deprecated
83@ CHECK: stmdb r1!, {r0, sp, pc}
84@ CHECK: ^
85	stmdb r2!, {sp, pc}
86@ CHECK: warning: use of SP or PC in the list is deprecated
87@ CHECK: stmdb r2!, {sp, pc}
88@ CHECK: ^
89	stmdb sp!, {pc}
90@ CHECK: warning: use of SP or PC in the list is deprecated
91@ CHECK: stmdb sp!, {pc}
92@ CHECK: ^
93	stmdb r0!, {sp}
94@ CHECK: warning: use of SP or PC in the list is deprecated
95@ CHECK: stmdb r0!, {sp}
96@ CHECK: ^
97
98	.global stmib
99	.type stmib,%function
100stmib:
101	stmib sp!, {r0, pc}
102@ CHECK: warning: use of SP or PC in the list is deprecated
103@ CHECK: stmib sp!, {r0, pc}
104@ CHECK: ^
105	stmib r0!, {r0, sp}
106@ CHECK: warning: use of SP or PC in the list is deprecated
107@ CHECK: stmib r0!, {r0, sp}
108@ CHECK: ^
109	stmib r1!, {r0, sp, pc}
110@ CHECK: warning: use of SP or PC in the list is deprecated
111@ CHECK: stmib r1!, {r0, sp, pc}
112@ CHECK: ^
113	stmib r2!, {sp, pc}
114@ CHECK: warning: use of SP or PC in the list is deprecated
115@ CHECK: stmib r2!, {sp, pc}
116@ CHECK: ^
117	stmib sp!, {pc}
118@ CHECK: warning: use of SP or PC in the list is deprecated
119@ CHECK: stmib sp!, {pc}
120@ CHECK: ^
121	stmib r0!, {sp}
122@ CHECK: warning: use of SP or PC in the list is deprecated
123@ CHECK: stmib r0!, {sp}
124@ CHECK: ^
125
126
127	.global push
128	.type push,%function
129push:
130	push {r0, pc}
131@ CHECK: warning: use of SP or PC in the list is deprecated
132@ CHECK: push {r0, pc}
133@ CHECK: ^
134	push {r0, sp}
135@ CHECK: warning: use of SP or PC in the list is deprecated
136@ CHECK: push {r0, sp}
137@ CHECK: ^
138	push {r0, sp, pc}
139@ CHECK: warning: use of SP or PC in the list is deprecated
140@ CHECK: push {r0, sp, pc}
141@ CHECK: ^
142	push {sp, pc}
143@ CHECK: warning: use of SP or PC in the list is deprecated
144@ CHECK: push {sp, pc}
145@ CHECK: ^
146	push {pc}
147@ CHECK: warning: use of SP or PC in the list is deprecated
148@ CHECK: push {pc}
149@ CHECK: ^
150	push {sp}
151@ CHECK: warning: use of SP or PC in the list is deprecated
152@ CHECK: push {sp}
153@ CHECK: ^
154
155	.global ldm
156	.type ldm,%function
157ldm:
158	ldm r0!, {r1, sp}
159@ CHECK: warning: use of SP in the list is deprecated
160	ldm r0!, {sp}
161@ CHECK: warning: use of SP in the list is deprecated
162	ldm r0!, {r1, lr, pc}
163@ CHECK: warning: use of LR and PC simultaneously in the list is deprecated
164	ldm r0!, {lr, pc}
165@ CHECK: warning: use of LR and PC simultaneously in the list is deprecated
166
167	.global ldmda
168	.type ldmda,%function
169ldmda:
170	ldmda r0!, {r1, sp}
171@ CHECK: warning: use of SP in the list is deprecated
172	ldmda r0!, {sp}
173@ CHECK: warning: use of SP in the list is deprecated
174	ldmda r0!, {r1, lr, pc}
175@ CHECK: warning: use of LR and PC simultaneously in the list is deprecated
176	ldmda r0!, {lr, pc}
177@ CHECK: warning: use of LR and PC simultaneously in the list is deprecated
178
179	.global ldmdb
180	.type ldmdb,%function
181ldmdb:
182	ldmdb r0!, {r1, sp}
183@ CHECK: warning: use of SP in the list is deprecated
184	ldmdb r0!, {sp}
185@ CHECK: warning: use of SP in the list is deprecated
186	ldmdb r0!, {r1, lr, pc}
187@ CHECK: warning: use of LR and PC simultaneously in the list is deprecated
188	ldmdb r0!, {lr, pc}
189@ CHECK: warning: use of LR and PC simultaneously in the list is deprecated
190
191	.global ldmib
192	.type ldmib,%function
193ldmib:
194	ldmib r0!, {r1, sp}
195@ CHECK: warning: use of SP in the list is deprecated
196	ldmib r0!, {sp}
197@ CHECK: warning: use of SP in the list is deprecated
198	ldmib r0!, {r1, lr, pc}
199@ CHECK: warning: use of LR and PC simultaneously in the list is deprecated
200	ldmib r0!, {lr, pc}
201@ CHECK: warning: use of LR and PC simultaneously in the list is deprecated
202
203	.global pop
204	.type pop,%function
205pop:
206	pop {r0, sp}
207@ CHECK: warning: use of SP in the list is deprecated
208@ CHECK-V7: error: writeback register not allowed in register list
209	pop {sp}
210@ CHECK: warning: use of SP in the list is deprecated
211@ CHECK-V7: error: writeback register not allowed in register list
212	pop {r0, lr, pc}
213@ CHECK: warning: use of LR and PC simultaneously in the list is deprecated
214	pop {lr, pc}
215@ CHECK: warning: use of LR and PC simultaneously in the list is deprecated
216
217	.global valid
218	.type valid,%function
219valid:
220	stmdaeq r0, {r0}
221@ CHECK: stmdaeq r0, {r0}
222	ldmdaeq r0, {r0}
223@ CHECK: ldmdaeq r0, {r0}
224	pop {r0, pc}
225@ CHECK: pop {r0, pc}
226
227