From fd950d2ff0c8c083acdccd9d4c925cf4e62c5006 Mon Sep 17 00:00:00 2001 From: Renato Golin Date: Thu, 12 May 2016 21:22:37 +0000 Subject: [PATCH] [ARM] Fixup tests to take into account mov translation. NFC. Alter instances in the test-suite that use immediates that can be represented in the immediate field of a MOV. The reason for doing this is that when the LDR rt,=imm transformation to MOV rt, imm the existing tests do not need to be modified. Required by the patch that fixes PR25722. Patch by Peter Smith. llvm-svn: 269353 --- test/CodeGen/ARM/inlineasm-ldr-pseudo.ll | 4 +-- test/MC/ARM/ldr-pseudo-darwin.s | 32 ++++++++++++------------ test/MC/ARM/ldr-pseudo-obj-errors.s | 4 +-- test/MC/ARM/ldr-pseudo.s | 32 ++++++++++++------------ test/MC/ARM/ltorg-darwin.s | 20 +++++++-------- test/MC/ARM/ltorg.s | 20 +++++++-------- 6 files changed, 56 insertions(+), 56 deletions(-) diff --git a/test/CodeGen/ARM/inlineasm-ldr-pseudo.ll b/test/CodeGen/ARM/inlineasm-ldr-pseudo.ll index f63e4b0b3a1..98665f056a2 100644 --- a/test/CodeGen/ARM/inlineasm-ldr-pseudo.ll +++ b/test/CodeGen/ARM/inlineasm-ldr-pseudo.ll @@ -9,9 +9,9 @@ ; CHECK: 0: 00 00 9f e5 ldr r0, [pc] ; CHECK: 4: 0e f0 a0 e1 mov pc, lr ; Make sure the constant pool entry comes after the return -; CHECK: 8: 01 00 00 00 +; CHECK: 8: 78 56 34 12 define i32 @foo() nounwind { entry: - %0 = tail call i32 asm sideeffect "ldr $0,=1", "=r"() nounwind + %0 = tail call i32 asm sideeffect "ldr $0,=0x12345678", "=r"() nounwind ret i32 %0 } diff --git a/test/MC/ARM/ldr-pseudo-darwin.s b/test/MC/ARM/ldr-pseudo-darwin.s index 086a7a86848..2395e1ad2c9 100644 --- a/test/MC/ARM/ldr-pseudo-darwin.s +++ b/test/MC/ARM/ldr-pseudo-darwin.s @@ -15,20 +15,20 @@ .section __TEXT,b,regular,pure_instructions @ CHECK-LABEL: f3: f3: - ldr r0, =0x10001 + ldr r0, =0x10002 @ CHECK: ldr r0, Ltmp0 @ loading multiple constants .section __TEXT,c,regular,pure_instructions @ CHECK-LABEL: f4: f4: - ldr r0, =0x10002 + ldr r0, =0x10003 @ CHECK: ldr r0, Ltmp1 adds r0, r0, #1 adds r0, r0, #1 adds r0, r0, #1 adds r0, r0, #1 - ldr r0, =0x10003 + ldr r0, =0x10004 @ CHECK: ldr r0, Ltmp2 adds r0, r0, #1 adds r0, r0, #1 @@ -37,7 +37,7 @@ f4: .section __TEXT,d,regular,pure_instructions @ CHECK-LABEL: f5: f5: - ldr r0, =0x10004 + ldr r0, =0x10005 @ CHECK: ldr r0, Ltmp3 adds r0, r0, #1 adds r0, r0, #1 @@ -46,7 +46,7 @@ f5: adds r0, r0, #1 adds r0, r0, #1 adds r0, r0, #1 - ldr r0, =0x10004 + ldr r0, =0x10005 @ CHECK: ldr r0, Ltmp4 adds r0, r0, #1 adds r0, r0, #1 @@ -117,7 +117,7 @@ f12: f13: adds r0, r0, #1 adds r0, r0, #1 - ldr r0, =0x101 + ldr r0, =0x10008 @ CHECK: ldr r0, Ltmp10 adds r0, r0, #1 adds r0, r0, #1 @@ -131,7 +131,7 @@ f13: @ usage in macro .macro useit_in_a_macro - ldr r0, =0x10008 + ldr r0, =0x10009 ldr r0, =baz .endm .section __TEXT,k,regular,pure_instructions @@ -145,7 +145,7 @@ f14: .section __TEXT,l,regular,pure_instructions @ CHECK-LABEL: f15: f15: - ldr r0, =0x10001+8 + ldr r0, =0x10001+9 @ CHECK: ldr r0, Ltmp14 adds r0, r0, #1 ldr r0, =bar+4 @@ -159,27 +159,27 @@ f15: @ CHECK: .data_region @ CHECK: .p2align 2 @ CHECK-LABEL: Ltmp0: -@ CHECK: .long 65537 +@ CHECK: .long 65538 @ CHECK: .end_data_region @ CHECK: .section __TEXT,c,regular,pure_instructions @ CHECK: .data_region @ CHECK: .p2align 2 @ CHECK-LABEL: Ltmp1: -@ CHECK: .long 65538 +@ CHECK: .long 65539 @ CHECK: .p2align 2 @ CHECK-LABEL: Ltmp2: -@ CHECK: .long 65539 +@ CHECK: .long 65540 @ CHECK: .end_data_region @ CHECK: .section __TEXT,d,regular,pure_instructions @ CHECK: .data_region @ CHECK: .p2align 2 @ CHECK-LABEL: Ltmp3: -@ CHECK: .long 65540 +@ CHECK: .long 65541 @ CHECK: .p2align 2 @ CHECK-LABEL: Ltmp4: -@ CHECK: .long 65540 +@ CHECK: .long 65541 @ CHECK: .end_data_region @ CHECK: .section __TEXT,e,regular,pure_instructions @@ -220,7 +220,7 @@ f15: @ CHECK: .data_region @ CHECK: .p2align 2 @ CHECK-LABEL: Ltmp10: -@ CHECK: .long 257 +@ CHECK: .long 65544 @ CHECK: .p2align 2 @ CHECK-LABEL: Ltmp11: @ CHECK: .long bar @@ -230,7 +230,7 @@ f15: @ CHECK: .data_region @ CHECK: .p2align 2 @ CHECK-LABEL: Ltmp12: -@ CHECK: .long 65544 +@ CHECK: .long 65545 @ CHECK: .p2align 2 @ CHECK-LABEL: Ltmp13: @ CHECK: .long baz @@ -240,7 +240,7 @@ f15: @ CHECK: .data_region @ CHECK: .p2align 2 @ CHECK-LABEL: Ltmp14: -@ CHECK: .long 65545 +@ CHECK: .long 65546 @ CHECK: .p2align 2 @ CHECK-LABEL: Ltmp15: @ CHECK: .long bar+4 diff --git a/test/MC/ARM/ldr-pseudo-obj-errors.s b/test/MC/ARM/ldr-pseudo-obj-errors.s index dce88f058f8..a2884853cea 100644 --- a/test/MC/ARM/ldr-pseudo-obj-errors.s +++ b/test/MC/ARM/ldr-pseudo-obj-errors.s @@ -10,8 +10,8 @@ .text foo: - ldr r0, =0x101 + ldr r0, =0x12345678 .space 8000 @ CHECK: error: out of range pc-relative fixup value -@ CHECK: ldr r0, =0x101 +@ CHECK: ldr r0, =0x12345678 @ CHECK: ^ diff --git a/test/MC/ARM/ldr-pseudo.s b/test/MC/ARM/ldr-pseudo.s index cb000bbfdfc..57bf6e77329 100644 --- a/test/MC/ARM/ldr-pseudo.s +++ b/test/MC/ARM/ldr-pseudo.s @@ -15,20 +15,20 @@ .section b,"ax",%progbits @ CHECK-LABEL: f3: f3: - ldr r0, =0x10001 + ldr r0, =0x10002 @ CHECK: ldr r0, .Ltmp[[TMP0:[0-9]+]] @ loading multiple constants .section c,"ax",%progbits @ CHECK-LABEL: f4: f4: - ldr r0, =0x10002 + ldr r0, =0x10003 @ CHECK: ldr r0, .Ltmp[[TMP1:[0-9]+]] adds r0, r0, #1 adds r0, r0, #1 adds r0, r0, #1 adds r0, r0, #1 - ldr r0, =0x10003 + ldr r0, =0x10004 @ CHECK: ldr r0, .Ltmp[[TMP2:[0-9]+]] adds r0, r0, #1 adds r0, r0, #1 @@ -37,7 +37,7 @@ f4: .section d,"ax",%progbits @ CHECK-LABEL: f5: f5: - ldr r0, =0x10004 + ldr r0, =0x10005 @ CHECK: ldr r0, .Ltmp[[TMP3:[0-9]+]] adds r0, r0, #1 adds r0, r0, #1 @@ -46,7 +46,7 @@ f5: adds r0, r0, #1 adds r0, r0, #1 adds r0, r0, #1 - ldr r0, =0x10004 + ldr r0, =0x10005 @ CHECK: ldr r0, .Ltmp[[TMP4:[0-9]+]] adds r0, r0, #1 adds r0, r0, #1 @@ -117,7 +117,7 @@ f12: f13: adds r0, r0, #1 adds r0, r0, #1 - ldr r0, =0x101 + ldr r0, =0x10008 @ CHECK: ldr r0, .Ltmp[[TMP10:[0-9]+]] adds r0, r0, #1 adds r0, r0, #1 @@ -131,7 +131,7 @@ f13: @ usage in macro .macro useit_in_a_macro - ldr r0, =0x10008 + ldr r0, =0x10009 ldr r0, =baz .endm .section k,"ax",%progbits @@ -145,7 +145,7 @@ f14: .section l, "ax", %progbits @ CHECK-LABEL: f15: f15: - ldr r0, =0x10001+8 + ldr r0, =0x10001+9 @ CHECK: ldr r0, .Ltmp[[TMP14:[0-9]+]] adds r0, r0, #1 ldr r0, =bar+4 @@ -158,21 +158,21 @@ f15: @ CHECK: .section b,"ax",%progbits @ CHECK: .p2align 2 @ CHECK: .Ltmp[[TMP0]] -@ CHECK: .long 65537 +@ CHECK: .long 65538 @ CHECK: .section c,"ax",%progbits @ CHECK: .p2align 2 @ CHECK: .Ltmp[[TMP1]] -@ CHECK: .long 65538 -@ CHECK: .Ltmp[[TMP2]] @ CHECK: .long 65539 +@ CHECK: .Ltmp[[TMP2]] +@ CHECK: .long 65540 @ CHECK: .section d,"ax",%progbits @ CHECK: .p2align 2 @ CHECK: .Ltmp[[TMP3]] -@ CHECK: .long 65540 +@ CHECK: .long 65541 @ CHECK: .Ltmp[[TMP4]] -@ CHECK: .long 65540 +@ CHECK: .long 65541 @ CHECK: .section e,"ax",%progbits @ CHECK: .p2align 2 @@ -202,20 +202,20 @@ f15: @ CHECK: .section j,"ax",%progbits @ CHECK: .p2align 2 @ CHECK: .Ltmp[[TMP10]] -@ CHECK: .long 257 +@ CHECK: .long 65544 @ CHECK: .Ltmp[[TMP11]] @ CHECK: .long bar @ CHECK: .section k,"ax",%progbits @ CHECK: .p2align 2 @ CHECK: .Ltmp[[TMP12]] -@ CHECK: .long 65544 +@ CHECK: .long 65545 @ CHECK: .Ltmp[[TMP13]] @ CHECK: .long baz @ CHECK: .section l,"ax",%progbits @ CHECK: .p2align 2 @ CHECK: .Ltmp[[TMP14]] -@ CHECK: .long 65545 +@ CHECK: .long 65546 @ CHECK: .Ltmp[[TMP15]] @ CHECK: .long bar+4 diff --git a/test/MC/ARM/ltorg-darwin.s b/test/MC/ARM/ltorg-darwin.s index e3480520c67..e62aceaa6d2 100644 --- a/test/MC/ARM/ltorg-darwin.s +++ b/test/MC/ARM/ltorg-darwin.s @@ -12,7 +12,7 @@ .section __TEXT,a,regular,pure_instructions @ CHECK-LABEL: f2: f2: - ldr r0, =0x10001 + ldr r0, =0x10002 @ CHECK: ldr r0, Ltmp0 adds r0, r0, #1 adds r0, r0, #1 @@ -22,7 +22,7 @@ f2: @ CHECK: .data_region @ CHECK: .p2align 2 @ CHECK-LABEL: Ltmp0: -@ CHECK: .long 65537 +@ CHECK: .long 65538 @ CHECK: .end_data_region @ CHECK-LABEL: f3: @@ -34,7 +34,7 @@ f3: .section __TEXT,b,regular,pure_instructions @ CHECK-LABEL: f4: f4: - ldr r0, =0x10002 + ldr r0, =0x10003 @ CHECK: ldr r0, Ltmp1 adds r0, r0, #1 adds r0, r0, #1 @@ -44,14 +44,14 @@ f4: @ CHECK: .data_region @ CHECK: .p2align 2 @ CHECK-LABEL: Ltmp1: -@ CHECK: .long 65538 +@ CHECK: .long 65539 @ CHECK: .end_data_region @ CHECK-LABEL: f5: f5: adds r0, r0, #1 adds r0, r0, #1 - ldr r0, =0x10003 + ldr r0, =0x10004 @ CHECK: ldr r0, Ltmp2 adds r0, r0, #1 b f6 @@ -60,7 +60,7 @@ f5: @ CHECK: .data_region @ CHECK: .p2align 2 @ CHECK-LABEL: Ltmp2: -@ CHECK: .long 65539 +@ CHECK: .long 65540 @ CHECK: .end_data_region @ CHECK-LABEL: f6: @@ -109,7 +109,7 @@ f10: f11: adds r0, r0, #1 adds r0, r0, #1 - ldr r0, =0x10004 + ldr r0, =0x10005 @ CHECK: ldr r0, Ltmp4 b f12 .ltorg @@ -117,13 +117,13 @@ f11: @ CHECK: .data_region @ CHECK: .p2align 2 @ CHECK-LABEL: Ltmp4: -@ CHECK: .long 65540 +@ CHECK: .long 65541 @ CHECK: .end_data_region @ CHECK-LABEL: f12: f12: adds r0, r0, #1 - ldr r0, =0x10005 + ldr r0, =0x10006 @ CHECK: ldr r0, Ltmp5 .section __TEXT,f,regular,pure_instructions @@ -144,7 +144,7 @@ f13: @ CHECK: .data_region @ CHECK: .p2align 2 @ CHECK-LABEL: Ltmp5: -@ CHECK: .long 65541 +@ CHECK: .long 65542 @ CHECK: .end_data_region @ should not have a constant pool at end of section with empty constant pools diff --git a/test/MC/ARM/ltorg.s b/test/MC/ARM/ltorg.s index 3a3c02707b2..a19694c10ec 100644 --- a/test/MC/ARM/ltorg.s +++ b/test/MC/ARM/ltorg.s @@ -12,7 +12,7 @@ .section a,"ax",%progbits @ CHECK-LABEL: f2: f2: - ldr r0, =0x10001 + ldr r0, =0x10002 @ CHECK: ldr r0, .Ltmp[[TMP0:[0-9+]]] adds r0, r0, #1 adds r0, r0, #1 @@ -21,7 +21,7 @@ f2: @ constant pool @ CHECK: .p2align 2 @ CHECK: .Ltmp[[TMP0]] -@ CHECK: .long 65537 +@ CHECK: .long 65538 @ CHECK-LABEL: f3: f3: @@ -32,7 +32,7 @@ f3: .section b,"ax",%progbits @ CHECK-LABEL: f4: f4: - ldr r0, =0x10002 + ldr r0, =0x10003 @ CHECK: ldr r0, .Ltmp[[TMP1:[0-9+]]] adds r0, r0, #1 adds r0, r0, #1 @@ -41,13 +41,13 @@ f4: @ constant pool @ CHECK: .p2align 2 @ CHECK: .Ltmp[[TMP1]] -@ CHECK: .long 65538 +@ CHECK: .long 65539 @ CHECK-LABEL: f5: f5: adds r0, r0, #1 adds r0, r0, #1 - ldr r0, =0x10003 + ldr r0, =0x10004 @ CHECK: ldr r0, .Ltmp[[TMP2:[0-9+]]] adds r0, r0, #1 b f6 @@ -55,7 +55,7 @@ f5: @ constant pool @ CHECK: .p2align 2 @ CHECK: .Ltmp[[TMP2]] -@ CHECK: .long 65539 +@ CHECK: .long 65540 @ CHECK-LABEL: f6: f6: @@ -101,18 +101,18 @@ f10: f11: adds r0, r0, #1 adds r0, r0, #1 - ldr r0, =0x10004 + ldr r0, =0x10005 @ CHECK: ldr r0, .Ltmp[[TMP4:[0-9+]]] b f12 .ltorg @ constant pool @ CHECK: .p2align 2 @ CHECK: .Ltmp[[TMP4]] -@ CHECK: .long 65540 +@ CHECK: .long 65541 @ CHECK-LABEL: f12: f12: adds r0, r0, #1 - ldr r0, =0x10005 + ldr r0, =0x10006 @ CHECK: ldr r0, .Ltmp[[TMP5:[0-9+]]] .section f,"ax",%progbits @@ -132,7 +132,7 @@ f13: @ constant pool @ CHECK: .p2align 2 @ CHECK: .Ltmp[[TMP5]] -@ CHECK: .long 65541 +@ CHECK: .long 65542 @ should not have a constant pool at end of section with empty constant pools @ CHECK-NOT: .section f,"ax",%progbits