xref: /aosp_15_r20/external/llvm/test/MC/ARM/eh-directive-movsp-diagnostics.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker@ RUN: not llvm-mc -triple armv7-eabi -filetype asm -o /dev/null 2>&1 %s \
2*9880d681SAndroid Build Coastguard Worker@ RUN:  | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker	.syntax unified
5*9880d681SAndroid Build Coastguard Worker	.thumb
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker	.global false_start
8*9880d681SAndroid Build Coastguard Worker	.type false_start,%function
9*9880d681SAndroid Build Coastguard Worker	.thumb_func
10*9880d681SAndroid Build Coastguard Workerfalse_start:
11*9880d681SAndroid Build Coastguard Worker	.movsp r7
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Worker@ CHECK: error: .fnstart must precede .movsp directive
14*9880d681SAndroid Build Coastguard Worker@ CHECK: 	.movsp r7
15*9880d681SAndroid Build Coastguard Worker@ CHECK:        ^
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Worker	.global beyond_saving
18*9880d681SAndroid Build Coastguard Worker	.type beyond_saving,%function
19*9880d681SAndroid Build Coastguard Worker	.thumb_func
20*9880d681SAndroid Build Coastguard Workerbeyond_saving:
21*9880d681SAndroid Build Coastguard Worker	.fnstart
22*9880d681SAndroid Build Coastguard Worker	.setfp r11, sp, #8
23*9880d681SAndroid Build Coastguard Worker	add r11, sp, #8
24*9880d681SAndroid Build Coastguard Worker	.movsp r7
25*9880d681SAndroid Build Coastguard Worker	mov r7, r11
26*9880d681SAndroid Build Coastguard Worker	.fnend
27*9880d681SAndroid Build Coastguard Worker
28*9880d681SAndroid Build Coastguard Worker@ CHECK: error: unexpected .movsp directive
29*9880d681SAndroid Build Coastguard Worker@ CHECK: 	.movsp r7
30*9880d681SAndroid Build Coastguard Worker@ CHECK:        ^
31*9880d681SAndroid Build Coastguard Worker
32*9880d681SAndroid Build Coastguard Worker
33*9880d681SAndroid Build Coastguard Worker	.global sp_invalid
34*9880d681SAndroid Build Coastguard Worker	.type sp_invalid,%function
35*9880d681SAndroid Build Coastguard Worker	.thumb_func
36*9880d681SAndroid Build Coastguard Workersp_invalid:
37*9880d681SAndroid Build Coastguard Worker	.fnstart
38*9880d681SAndroid Build Coastguard Worker	.movsp r13
39*9880d681SAndroid Build Coastguard Worker	mov sp, sp
40*9880d681SAndroid Build Coastguard Worker	.fnend
41*9880d681SAndroid Build Coastguard Worker
42*9880d681SAndroid Build Coastguard Worker@ CHECK: error: sp and pc are not permitted in .movsp directive
43*9880d681SAndroid Build Coastguard Worker@ CHECK: 	.movsp r13
44*9880d681SAndroid Build Coastguard Worker@ CHECK:               ^
45*9880d681SAndroid Build Coastguard Worker
46*9880d681SAndroid Build Coastguard Worker
47*9880d681SAndroid Build Coastguard Worker	.global pc_invalid
48*9880d681SAndroid Build Coastguard Worker	.type pc_invalid,%function
49*9880d681SAndroid Build Coastguard Worker	.thumb_func
50*9880d681SAndroid Build Coastguard Workerpc_invalid:
51*9880d681SAndroid Build Coastguard Worker	.fnstart
52*9880d681SAndroid Build Coastguard Worker	.movsp r15
53*9880d681SAndroid Build Coastguard Worker	mov sp, pc
54*9880d681SAndroid Build Coastguard Worker	.fnend
55*9880d681SAndroid Build Coastguard Worker
56*9880d681SAndroid Build Coastguard Worker@ CHECK: error: sp and pc are not permitted in .movsp directive
57*9880d681SAndroid Build Coastguard Worker@ CHECK: 	.movsp r15
58*9880d681SAndroid Build Coastguard Worker@ CHECK:               ^
59*9880d681SAndroid Build Coastguard Worker
60*9880d681SAndroid Build Coastguard Worker
61*9880d681SAndroid Build Coastguard Worker	.global constant_required
62*9880d681SAndroid Build Coastguard Worker	.type constant_required,%function
63*9880d681SAndroid Build Coastguard Worker	.thumb_func
64*9880d681SAndroid Build Coastguard Workerconstant_required:
65*9880d681SAndroid Build Coastguard Worker	.fnstart
66*9880d681SAndroid Build Coastguard Worker	.movsp r11,
67*9880d681SAndroid Build Coastguard Worker	mov sp, r11
68*9880d681SAndroid Build Coastguard Worker	.fnend
69*9880d681SAndroid Build Coastguard Worker
70*9880d681SAndroid Build Coastguard Worker@ CHECK: error: expected #constant
71*9880d681SAndroid Build Coastguard Worker@ CHECK: 	.movsp r11,
72*9880d681SAndroid Build Coastguard Worker@ CHECK:                   ^
73*9880d681SAndroid Build Coastguard Worker
74*9880d681SAndroid Build Coastguard Worker
75*9880d681SAndroid Build Coastguard Worker	.global constant_constant
76*9880d681SAndroid Build Coastguard Worker	.type constant_constant,%function
77*9880d681SAndroid Build Coastguard Worker	.thumb_func
78*9880d681SAndroid Build Coastguard Workerconstant_constant:
79*9880d681SAndroid Build Coastguard Worker	.fnstart
80*9880d681SAndroid Build Coastguard Worker	.movsp r11, #constant
81*9880d681SAndroid Build Coastguard Worker	mov sp, r11
82*9880d681SAndroid Build Coastguard Worker	.fnend
83*9880d681SAndroid Build Coastguard Worker
84*9880d681SAndroid Build Coastguard Worker@ CHECK: error: offset must be an immediate constant
85*9880d681SAndroid Build Coastguard Worker@ CHECK: 	.movsp r11, #constant
86*9880d681SAndroid Build Coastguard Worker@ CHECK:                     ^
87*9880d681SAndroid Build Coastguard Worker
88*9880d681SAndroid Build Coastguard Worker
89*9880d681SAndroid Build Coastguard Worker	.arm
90*9880d681SAndroid Build Coastguard Worker
91*9880d681SAndroid Build Coastguard Worker	.global register_required
92*9880d681SAndroid Build Coastguard Worker	.type register_required,%function
93*9880d681SAndroid Build Coastguard Workerregister_required:
94*9880d681SAndroid Build Coastguard Worker	.fnstart
95*9880d681SAndroid Build Coastguard Worker	.movsp #42
96*9880d681SAndroid Build Coastguard Worker	mov sp, #42
97*9880d681SAndroid Build Coastguard Worker	.fnend
98*9880d681SAndroid Build Coastguard Worker
99*9880d681SAndroid Build Coastguard Worker@ CHECK: error: register expected
100*9880d681SAndroid Build Coastguard Worker@ CHECK: 	.movsp #42
101*9880d681SAndroid Build Coastguard Worker@ CHECK:               ^
102*9880d681SAndroid Build Coastguard Worker
103