[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / ARM / directive-if-subtraction.s
blobedb386593ba637ed55675c94f80ae29136f286ed
1 // RUN: llvm-mc -triple armv7a-linux-gnueabihf %s -filetype=obj -o /dev/null 2>&1 | FileCheck --check-prefix=OBJ --allow-empty %s
2 // RUN: not llvm-mc -triple armv7a-linux-gnueabihf %s -o /dev/null 2>&1 | FileCheck --check-prefix=ASM %s
3 // RUN: llvm-mc -triple armv7a-linux-gnueabihf %s -filetype=obj -o - | llvm-objdump -d - | FileCheck --check-prefix=DISASM %s
5 nop
6 // Create a new MCDataFragment due to Subtarget change
7 .arch_extension sec
8 9997:nop
9 .if . - 9997b == 0
10 // OBJ-NOT:[[@LINE-1]]:5: error: expected absolute expression
11 // ASM:[[@LINE-2]]:5: error: expected absolute expression
12 // DISASM: orr r1, r1, #2
13 orr r1, r1, #1
14 .else
15 orr r1, r1, #2
16 .endif
20 @ 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
21 @ 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
23 .ifdef ERR
24 9997: nop
25 .align 4
26 nop
27 .if . - 9997b == 4
28 // ARM-ERR:[[@LINE-1]]:5: error: expected absolute expression
29 .endif
31 9997: nop
32 .space 4
33 nop
34 .if . - 9997b == 4
35 // ARM-ERR:[[@LINE-1]]:5: error: expected absolute expression
36 .endif
38 9997:
39 ldr r0,=0x12345678
40 .ltorg
41 nop
42 .if . - 9997b == 4
43 // ARM-ERR:[[@LINE-1]]:5: error: expected absolute expression
44 .endif
46 9997: nop
47 b external
48 nop
49 .if . - 9997b == 4
50 // THUMB2-ERR:[[@LINE-1]]:5: error: expected absolute expression
51 .endif
52 .endif