xref: /llvm-project/llvm/test/MC/ARM/directive-if-subtraction.s (revision fb294c0612a12f2a39be90df0c3a22f66d4ab9f7)
1// RUN: not llvm-mc -triple armv7a-linux-gnueabihf %s -o /dev/null 2>&1 | FileCheck --check-prefix=ASM %s --implicit-check-not=error:
2// RUN: llvm-mc -triple armv7a-linux-gnueabihf %s -filetype=obj -o %t 2>&1 | count 0
3// RUN: llvm-objdump -d %t | FileCheck --check-prefix=DISASM %s
4
5nop
6// Create a new MCDataFragment due to Subtarget change
7.arch_extension sec
89997:nop
9.if . - 9997b == 0
10// ASM:    :[[#@LINE-1]]:5: error: expected absolute expression
11// DISASM: orr	r1, r1, #2
12orr r1, r1, #1
13.else
14orr r1, r1, #2
15.endif
16
17nop
18.arch_extension sec
199997:nop
20.if 9997b - . == 0
21// ASM:    :[[#@LINE-1]]:5: error: expected absolute expression
22// DISASM: orr	r1, r1, #2
23orr r1, r1, #1
24.else
25orr r1, r1, #2
26.endif
27
28@ RUN: not llvm-mc -filetype=obj -triple arm-linux-gnueabihf --defsym=ERR=1 %s -o /dev/null 2>&1 | FileCheck --check-prefix=ARM-ERR %s
29@ RUN: not llvm-mc -filetype=obj -triple thumbv7a-linux-gnueabihf --defsym=ERR=1 %s -o /dev/null 2>&1 | FileCheck --check-prefix=THUMB2-ERR %s
30
31.ifdef ERR
329997: nop
33      .align 4
34      nop
35.if . - 9997b == 4
36// ARM-ERR:[[@LINE-1]]:5: error: expected absolute expression
37.endif
38
399997: nop
40      .space 4
41      nop
42.if . - 9997b == 4
43.endif
44
459997:
46      ldr r0,=0x12345678
47      .ltorg
48      nop
49.if . - 9997b == 4
50// ARM-ERR:[[@LINE-1]]:5: error: expected absolute expression
51.endif
52
539997: nop
54      b external
55      nop
56.if . - 9997b == 4
57// THUMB2-ERR:[[@LINE-1]]:5: error: expected absolute expression
58.endif
59.endif
60