Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / MC / ARM / arm-memory-instructions-immediate.s
blobd72028edc9e21bada75bc09b7e99c07fa442719a
1 // RUN: llvm-mc -triple=armv7 -filetype=obj %s | llvm-objdump --no-print-imm-hex --triple=armv7 -d - | FileCheck %s
2 // RUN: not llvm-mc -triple=armv7 -filetype=obj --defsym=ERR=1 < %s -o /dev/null 2>&1 | FileCheck --check-prefix=ERR %s
4 .syntax unified
5 // Check that the assembler accepts the result of symbolic expressions as the
6 // immediate operand in load and stores.
7 0:
8 // CHECK-LABEL: foo
9 .space 1024
11 foo:
12 ldr r0, [r1, #(1b - 0b)]
13 // CHECK-NEXT: ldr r0, [r1, #1024]
14 ldr r0, [r1, #(0b - 1b)]
15 // CHECK-NEXT: ldr r0, [r1, #-1024]
16 ldrb r0, [r1, #(1b-0b)]
17 // CHECK-NEXT: ldrb r0, [r1, #1024]
18 str r0, [r1, #(1b-0b)]
19 // CHECK-NEXT: str r0, [r1, #1024]
20 strb r0, [r1, #(1b-0b)]
21 // CHECK-NEXT: strb r0, [r1, #1024]
22 .ifdef ERR
23 str r0, [r1, 1b]
24 // ERR:[[#@LINE-1]]:5: error: unsupported relocation type
25 .endif