[ARM] Better OR's for MVE compares
[llvm-core.git] / test / MC / AsmParser / altmacro_expression.s
blob58d8b486cf85dd568d64363c2a4e8a6e760feac4
1 # RUN: llvm-mc -triple i386-linux-gnu %s | FileCheck %s
3 # Checking that the '%' was evaluated as a string first
4 # In a fail scenario: The asmprint will print: addl $%(1+4), %eax
6 # CHECK: addl $5, %eax
7 .altmacro
8 .macro percent_expr arg
9 addl $\arg, %eax
10 .endm
12 percent_expr %(1+4)
15 # Checking that the second '%' acts as modulo operator
16 # The altmacro percent '%' must be located before the first argument
17 # If a percent is located in the middle of the estimated argument without any
18 # '%' in the beginning , error will be generated.
19 # The second percent '%' after the first altmacro percent '%' is a regular operator.
21 # CHECK: addl $1, %eax
22 .macro inner_percent arg
23 addl $\arg, %eax
24 .endm
26 inner_percent %(1%4)
29 # Checking for nested macro
30 # The first argument use is for the calling function and the second use is for the evaluation.
32 # CHECK: addl $1, %eax
33 .macro macro_call_0 number
34 addl $\number, %eax
35 .endm
37 .macro macro_call_1 number
38 macro_call_\number %(\number + 1)
39 .endm
41 macro_call_1 %(1-1)
44 # Checking the ability to pass a number of arguments.
45 # The arguments can be separated by ',' or not.
47 # CHECK: label013:
48 # CHECK: addl $0, %eax
49 # CHECK: addl $1, %eax
50 # CHECK: addl $3, %eax
52 # CHECK: label014:
53 # CHECK: addl $0, %eax
54 # CHECK: addl $1, %eax
55 # CHECK: addl $4, %eax
57 .macro multi_args_macro arg1 arg2 arg3
58 label\arg1\arg2\arg3:
59 addl $\arg1, %eax
60 addl $\arg2, %eax
61 addl $\arg3, %eax
62 .endm
64 multi_args_macro %(1+4-5) 1 %2+1
65 multi_args_macro %(1+4-5),1,%4%10