[llvm-readobj] - Simplify stack-sizes.test test case.
[llvm-complete.git] / test / MC / AsmParser / altmacro_string.s
blobce024676b257318086f42946295fc629a7ed4ef2
1 # RUN: llvm-mc -triple i386-linux-gnu %s| FileCheck %s
3 # This test checks the altmacro string delimiter '<' and '>'.
5 .altmacro
7 # Test #1:
8 # You can delimit strings with matching angle brackets '<' '>'.
9 # If an argument begins with '<' and ends with '>'.
10 # The argument is considered as a string.
12 # CHECK: simpleCheck:
13 .macro simple_check_0 name
14 \name:
15 addl $5,%eax
16 .endm
18 simple_check_0 <simpleCheck>
20 # Test #2:
21 # Except adding new string marks '<..>', a regular macro behavior is expected.
23 # CHECK: simpleCheck0:
24 # CHECK: addl $0, %eax
25 .macro concat string1 string2 string3
26 \string1\string2\string3:
27 addl $\string3, %eax
28 .endm
30 concat <simple>,<Check>,<0>
32 # Test #3:
33 # The altmacro cannot affect the regular less/greater behavior.
35 # CHECK: addl $-1, %eax
36 # CHECK: addl $0, %eax
38 .macro fun3 arg1 arg2
39 addl $\arg1,%eax
40 addl $\arg2,%eax
41 .endm
43 fun3 5<6 , 5>8
45 # Test #4:
46 # If a comma is present inside an angle brackets,
47 # the comma considered as a character and not as a separator.
48 # This check checks the ability to split the string to different
49 # arguments according to the use of the comma.
50 # Fun2 sees the comma as a character.
51 # Fun3 sees the comma as a separator.
53 # CHECK: addl $5, %eax
54 # CHECK: addl $6, %eax
55 .macro fun2 arg
56 fun3 \arg
57 .endm
59 fun2 <5,6>
61 # Test #5:
62 # If argument begin with '<' and there is no '>' to close it.
63 # A regular macro behavior is expected.
65 # CHECK: addl $4, %eax
66 .macro fun4 arg1 arg2
67 .if \arg2\arg1
68 addl $\arg2,%eax
69 .endif
70 .endm
72 fun4 <5,4
73 .noaltmacro