1*9880d681SAndroid Build Coastguard Worker@ RUN: not llvm-mc -triple thumbv7-eabi -filetype asm -o - %s 2>&1 \ 2*9880d681SAndroid Build Coastguard Worker@ RUN: | FileCheck %s 3*9880d681SAndroid Build Coastguard Worker@ RUN: not llvm-mc -triple thumbv7a-eabi -filetype asm -o - %s 2>&1 \ 4*9880d681SAndroid Build Coastguard Worker@ RUN: | FileCheck --check-prefix=CHECK --check-prefix=CHECK-V7A %s 5*9880d681SAndroid Build Coastguard Worker@ RUN: not llvm-mc -triple thumbv7m-eabi -filetype asm -o - %s 2>&1 \ 6*9880d681SAndroid Build Coastguard Worker@ RUN: | FileCheck --check-prefix=CHECK --check-prefix=CHECK-V7M %s 7*9880d681SAndroid Build Coastguard Worker 8*9880d681SAndroid Build Coastguard Worker .syntax unified 9*9880d681SAndroid Build Coastguard Worker .thumb 10*9880d681SAndroid Build Coastguard Worker 11*9880d681SAndroid Build Coastguard Worker .global ldm 12*9880d681SAndroid Build Coastguard Worker .type ldm,%function 13*9880d681SAndroid Build Coastguard Workerldm: 14*9880d681SAndroid Build Coastguard Worker ldm r0!, {r1, sp} 15*9880d681SAndroid Build Coastguard Worker@ CHECK: error: SP may not be in the register list 16*9880d681SAndroid Build Coastguard Worker@ CHECK: ldm r0!, {r1, sp} 17*9880d681SAndroid Build Coastguard Worker@ CHECK: ^ 18*9880d681SAndroid Build Coastguard Worker ldm r0!, {lr, pc} 19*9880d681SAndroid Build Coastguard Worker@ CHECK: error: PC and LR may not be in the register list simultaneously 20*9880d681SAndroid Build Coastguard Worker@ CHECK: ldm r0!, {lr, pc} 21*9880d681SAndroid Build Coastguard Worker@ CHECK: ^ 22*9880d681SAndroid Build Coastguard Worker itt eq 23*9880d681SAndroid Build Coastguard Worker ldmeq r0!, {r1, pc} 24*9880d681SAndroid Build Coastguard Worker ldmeq r0!, {r2, lr} 25*9880d681SAndroid Build Coastguard Worker@ CHECK: error: instruction must be outside of IT block or the last instruction in an IT block 26*9880d681SAndroid Build Coastguard Worker@ CHECK: ldmeq r0!, {r1, pc} 27*9880d681SAndroid Build Coastguard Worker@ CHECK: ^ 28*9880d681SAndroid Build Coastguard Worker 29*9880d681SAndroid Build Coastguard Worker .global ldmdb 30*9880d681SAndroid Build Coastguard Worker .type ldmdb,%function 31*9880d681SAndroid Build Coastguard Workerldmdb: 32*9880d681SAndroid Build Coastguard Worker ldmdb r0!, {r1, sp} 33*9880d681SAndroid Build Coastguard Worker@ CHECK: error: SP may not be in the register list 34*9880d681SAndroid Build Coastguard Worker ldmdb r0!, {lr, pc} 35*9880d681SAndroid Build Coastguard Worker@ error: PC and LR may not be in the register list simultaneously 36*9880d681SAndroid Build Coastguard Worker itt eq 37*9880d681SAndroid Build Coastguard Worker ldmeq r0!, {r1, pc} 38*9880d681SAndroid Build Coastguard Worker ldmeq r0!, {r2, lr} 39*9880d681SAndroid Build Coastguard Worker@ CHECK: error: instruction must be outside of IT block or the last instruction in an IT block 40*9880d681SAndroid Build Coastguard Worker@ CHECK: ldmeq r0!, {r1, pc} 41*9880d681SAndroid Build Coastguard Worker@ CHECK: ^ 42*9880d681SAndroid Build Coastguard Worker 43*9880d681SAndroid Build Coastguard Worker .global stm 44*9880d681SAndroid Build Coastguard Worker .type stm,%function 45*9880d681SAndroid Build Coastguard Workerstm: 46*9880d681SAndroid Build Coastguard Worker stm r0!, {r1, sp} 47*9880d681SAndroid Build Coastguard Worker@ CHECK: error: SP may not be in the register list 48*9880d681SAndroid Build Coastguard Worker stm r0!, {r2, pc} 49*9880d681SAndroid Build Coastguard Worker@ CHECK: error: PC may not be in the register list 50*9880d681SAndroid Build Coastguard Worker stm r0!, {sp, pc} 51*9880d681SAndroid Build Coastguard Worker@ CHECK: error: SP and PC may not be in the register list 52*9880d681SAndroid Build Coastguard Worker 53*9880d681SAndroid Build Coastguard Worker .global stmdb 54*9880d681SAndroid Build Coastguard Worker .type stmdb,%function 55*9880d681SAndroid Build Coastguard Workerstmdb: 56*9880d681SAndroid Build Coastguard Worker stmdb r0!, {r1, sp} 57*9880d681SAndroid Build Coastguard Worker@ CHECK: error: SP may not be in the register list 58*9880d681SAndroid Build Coastguard Worker stmdb r0!, {r2, pc} 59*9880d681SAndroid Build Coastguard Worker@ CHECK: error: PC may not be in the register list 60*9880d681SAndroid Build Coastguard Worker stmdb r0!, {sp, pc} 61*9880d681SAndroid Build Coastguard Worker@ CHECK: error: SP and PC may not be in the register list 62*9880d681SAndroid Build Coastguard Worker 63*9880d681SAndroid Build Coastguard Worker .global push 64*9880d681SAndroid Build Coastguard Worker .type push,%function 65*9880d681SAndroid Build Coastguard Workerpush: 66*9880d681SAndroid Build Coastguard Worker push {sp} 67*9880d681SAndroid Build Coastguard Worker@ CHECK: error: SP may not be in the register list 68*9880d681SAndroid Build Coastguard Worker push {pc} 69*9880d681SAndroid Build Coastguard Worker@ CHECK: error: PC may not be in the register list 70*9880d681SAndroid Build Coastguard Worker push {sp, pc} 71*9880d681SAndroid Build Coastguard Worker@ CHECK: error: SP and PC may not be in the register list 72*9880d681SAndroid Build Coastguard Worker 73*9880d681SAndroid Build Coastguard Worker .global pop 74*9880d681SAndroid Build Coastguard Worker .type pop,%function 75*9880d681SAndroid Build Coastguard Workerpop: 76*9880d681SAndroid Build Coastguard Worker pop {sp} 77*9880d681SAndroid Build Coastguard Worker@ CHECK-V7M: error: SP may not be in the register list 78*9880d681SAndroid Build Coastguard Worker pop {lr, pc} 79*9880d681SAndroid Build Coastguard Worker@ CHECK: error: PC and LR may not be in the register list simultaneously 80*9880d681SAndroid Build Coastguard Worker@ CHECK: pop {lr, pc} 81*9880d681SAndroid Build Coastguard Worker@ CHECK: ^ 82*9880d681SAndroid Build Coastguard Worker itt eq 83*9880d681SAndroid Build Coastguard Worker popeq {r1, pc} 84*9880d681SAndroid Build Coastguard Worker popeq {r2, lr} 85*9880d681SAndroid Build Coastguard Worker@ CHECK: error: instruction must be outside of IT block or the last instruction in an IT block 86*9880d681SAndroid Build Coastguard Worker@ CHECK: popeq {r1, pc} 87*9880d681SAndroid Build Coastguard Worker@ CHECK: ^ 88*9880d681SAndroid Build Coastguard Worker 89*9880d681SAndroid Build Coastguard Worker .global valid 90*9880d681SAndroid Build Coastguard Worker .type valid,%function 91*9880d681SAndroid Build Coastguard Workervalid: 92*9880d681SAndroid Build Coastguard Worker pop {sp} 93*9880d681SAndroid Build Coastguard Worker@ CHECK-V7A: ldr sp, [sp], #4 94*9880d681SAndroid Build Coastguard Worker pop {sp, pc} 95*9880d681SAndroid Build Coastguard Worker@ CHECK-V7A: pop.w {sp, pc} 96*9880d681SAndroid Build Coastguard Worker push.w {r0} 97*9880d681SAndroid Build Coastguard Worker@ CHECK: str r0, [sp, #-4] 98*9880d681SAndroid Build Coastguard Worker pop.w {r0} 99*9880d681SAndroid Build Coastguard Worker@ CHECK: ldr r0, [sp], #4 100*9880d681SAndroid Build Coastguard Worker 101