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