1*9880d681SAndroid Build Coastguard Worker@RUN: llvm-mc -triple armv7-base-apple-darwin %s | FileCheck --check-prefix=CHECK-ARM --check-prefix=CHECK %s 2*9880d681SAndroid Build Coastguard Worker@RUN: llvm-mc -triple thumbv7-base-apple-darwin %s | FileCheck --check-prefix=CHECK-THUMB2 --check-prefix=CHECK %s 3*9880d681SAndroid Build Coastguard Worker 4*9880d681SAndroid Build Coastguard Worker@ 5*9880d681SAndroid Build Coastguard Worker@ Check that ldr to constant pool correctly transfers the condition codes 6*9880d681SAndroid Build Coastguard Worker@ 7*9880d681SAndroid Build Coastguard Worker@ simple test 8*9880d681SAndroid Build Coastguard Worker.section __TEXT,a,regular,pure_instructions 9*9880d681SAndroid Build Coastguard Worker@ CHECK-LABEL: f0: 10*9880d681SAndroid Build Coastguard Workerf0: 11*9880d681SAndroid Build Coastguard Worker it eq 12*9880d681SAndroid Build Coastguard Worker ldreq r0, =0x10002 13*9880d681SAndroid Build Coastguard Worker@ CHECK: ldreq r0, Ltmp0 14*9880d681SAndroid Build Coastguard Worker 15*9880d681SAndroid Build Coastguard Worker@ loading multiple constants 16*9880d681SAndroid Build Coastguard Worker.section __TEXT,b,regular,pure_instructions 17*9880d681SAndroid Build Coastguard Worker@ CHECK-LABEL: f1: 18*9880d681SAndroid Build Coastguard Workerf1: 19*9880d681SAndroid Build Coastguard Worker ite eq 20*9880d681SAndroid Build Coastguard Worker ldreq r0, =0x10003 21*9880d681SAndroid Build Coastguard Worker@ CHECK: ldreq r0, Ltmp1 22*9880d681SAndroid Build Coastguard Worker ldrne r0, =0x10004 23*9880d681SAndroid Build Coastguard Worker@ CHECK: ldrne r0, Ltmp2 24*9880d681SAndroid Build Coastguard Worker 25*9880d681SAndroid Build Coastguard Worker@ transformation to mov 26*9880d681SAndroid Build Coastguard Worker.section __TEXT,d,regular,pure_instructions 27*9880d681SAndroid Build Coastguard Worker@ CHECK-LABEL: f2: 28*9880d681SAndroid Build Coastguard Workerf2: 29*9880d681SAndroid Build Coastguard Worker@ Can use the narrow Thumb mov as it does not set flags in an IT block 30*9880d681SAndroid Build Coastguard Worker it eq 31*9880d681SAndroid Build Coastguard Worker ldreq r1, =0x1 32*9880d681SAndroid Build Coastguard Worker@ CHECK: moveq r1, #1 33*9880d681SAndroid Build Coastguard Worker 34*9880d681SAndroid Build Coastguard Worker@ Must use the wide Thumb mov if the constant can't be represented 35*9880d681SAndroid Build Coastguard Worker ite eq 36*9880d681SAndroid Build Coastguard Worker ldreq r2, = 0x1f000000 37*9880d681SAndroid Build Coastguard Worker@ CHECK-ARM moveq r2, #520093696 38*9880d681SAndroid Build Coastguard Worker@ CHECK-THUMB2 moveq.w r2, #520093696 39*9880d681SAndroid Build Coastguard Worker ldrne r3, = 0x00001234 40*9880d681SAndroid Build Coastguard Worker@ CHECK movwne r2, #4660 41*9880d681SAndroid Build Coastguard Worker 42*9880d681SAndroid Build Coastguard Worker@ 43*9880d681SAndroid Build Coastguard Worker@ Constant Pools 44*9880d681SAndroid Build Coastguard Worker@ 45*9880d681SAndroid Build Coastguard Worker@ CHECK: .section __TEXT,a,regular,pure_instructions 46*9880d681SAndroid Build Coastguard Worker@ CHECK: .p2align 2 47*9880d681SAndroid Build Coastguard Worker@ CHECK: Ltmp0: 48*9880d681SAndroid Build Coastguard Worker@ CHECK: .long 65538 49*9880d681SAndroid Build Coastguard Worker 50*9880d681SAndroid Build Coastguard Worker@ CHECK: .section __TEXT,b,regular,pure_instructions 51*9880d681SAndroid Build Coastguard Worker@ CHECK: .p2align 2 52*9880d681SAndroid Build Coastguard Worker@ CHECK: Ltmp1: 53*9880d681SAndroid Build Coastguard Worker@ CHECK: .long 65539 54*9880d681SAndroid Build Coastguard Worker@ CHECK: Ltmp2: 55*9880d681SAndroid Build Coastguard Worker@ CHECK: .long 65540 56