xref: /llvm-project/llvm/test/MC/ARM/unpred-control-flow-in-it-block.s (revision 85d4d5b4935e82b14c42ef3f77ca903a07c6a8de)
1*85d4d5b4SOliver Stannard@ RUN: not llvm-mc -triple=thumbv7m--none-eabi < %s 2>&1 | FileCheck %s
2*85d4d5b4SOliver Stannard
3*85d4d5b4SOliver Stannard@ These instructions all write to the PC, so are UNPREDICTABLE if they are in
4*85d4d5b4SOliver Stannard@ an IT block, but not the last instruction in the block.
5*85d4d5b4SOliver Stannard
6*85d4d5b4SOliver Stannard  itttt eq
7*85d4d5b4SOliver Stannard  addeq pc, r0
8*85d4d5b4SOliver Stannard@ CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction must be outside of IT block or the last instruction in an IT block
9*85d4d5b4SOliver Stannard  addeq pc, sp, pc
10*85d4d5b4SOliver Stannard@ CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction must be outside of IT block or the last instruction in an IT block
11*85d4d5b4SOliver Stannard  beq.n #.+0x20
12*85d4d5b4SOliver Stannard@ CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction must be outside of IT block or the last instruction in an IT block
13*85d4d5b4SOliver Stannard  nopeq
14*85d4d5b4SOliver Stannard  itttt eq
15*85d4d5b4SOliver Stannard  beq.w #.+0x20
16*85d4d5b4SOliver Stannard@ CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction must be outside of IT block or the last instruction in an IT block
17*85d4d5b4SOliver Stannard  bleq sym
18*85d4d5b4SOliver Stannard@ CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction must be outside of IT block or the last instruction in an IT block
19*85d4d5b4SOliver Stannard  blxeq r0
20*85d4d5b4SOliver Stannard@ CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction must be outside of IT block or the last instruction in an IT block
21*85d4d5b4SOliver Stannard  nopeq
22*85d4d5b4SOliver Stannard  itttt eq
23*85d4d5b4SOliver Stannard  bxeq r0
24*85d4d5b4SOliver Stannard@ CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction must be outside of IT block or the last instruction in an IT block
25*85d4d5b4SOliver Stannard  ldmeq r0, {r8, pc}
26*85d4d5b4SOliver Stannard@ CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction must be outside of IT block or the last instruction in an IT block
27*85d4d5b4SOliver Stannard  ldmdbeq r0, {r8, pc}
28*85d4d5b4SOliver Stannard@ CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction must be outside of IT block or the last instruction in an IT block
29*85d4d5b4SOliver Stannard  nopeq
30*85d4d5b4SOliver Stannard  itttt eq
31*85d4d5b4SOliver Stannard  ldreq pc, [r0, #4]
32*85d4d5b4SOliver Stannard@ CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction must be outside of IT block or the last instruction in an IT block
33*85d4d5b4SOliver Stannard  ldreq pc, [r0, #-4]
34*85d4d5b4SOliver Stannard@ CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction must be outside of IT block or the last instruction in an IT block
35*85d4d5b4SOliver Stannard  ldreq pc, [pc, #4]
36*85d4d5b4SOliver Stannard@ CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction must be outside of IT block or the last instruction in an IT block
37*85d4d5b4SOliver Stannard  nopeq
38*85d4d5b4SOliver Stannard  itttt eq
39*85d4d5b4SOliver Stannard  ldreq pc, [r0, r1, LSL #1]
40*85d4d5b4SOliver Stannard@ CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction must be outside of IT block or the last instruction in an IT block
41*85d4d5b4SOliver Stannard  moveq pc, r0
42*85d4d5b4SOliver Stannard@ CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction must be outside of IT block or the last instruction in an IT block
43*85d4d5b4SOliver Stannard  popeq {r0, pc}
44*85d4d5b4SOliver Stannard@ CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction must be outside of IT block or the last instruction in an IT block
45*85d4d5b4SOliver Stannard  nopeq
46*85d4d5b4SOliver Stannard  itttt eq
47*85d4d5b4SOliver Stannard  popeq {r8, pc}
48*85d4d5b4SOliver Stannard@ CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction must be outside of IT block or the last instruction in an IT block
49*85d4d5b4SOliver Stannard  popeq {pc}
50*85d4d5b4SOliver Stannard@ CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction must be outside of IT block or the last instruction in an IT block
51*85d4d5b4SOliver Stannard  tbbeq [r0, r1]
52*85d4d5b4SOliver Stannard@ CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction must be outside of IT block or the last instruction in an IT block
53*85d4d5b4SOliver Stannard  nopeq
54*85d4d5b4SOliver Stannard  itt eq
55*85d4d5b4SOliver Stannard  tbheq [r0, r1, LSL #1]
56*85d4d5b4SOliver Stannard@ CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction must be outside of IT block or the last instruction in an IT block
57*85d4d5b4SOliver Stannard  nopeq
58