74 lines · plain
1# RUN: llvm-mc -triple i386-linux-gnu %s| FileCheck %s2 3# This test checks the altmacro string delimiter '<' and '>'.4 5.altmacro6 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.11 12# CHECK: simpleCheck:13.macro simple_check_0 name14 \name:15 addl $5,%eax16.endm17 18simple_check_0 <simpleCheck>19 20# Test #2:21# Except adding new string marks '<..>', a regular macro behavior is expected.22 23# CHECK: simpleCheck0:24# CHECK: addl $0, %eax25.macro concat string1 string2 string326 \string1\string2\string3:27 addl $\string3, %eax28.endm29 30concat <simple>,<Check>,<0>31 32# Test #3:33# The altmacro cannot affect the regular less/greater behavior.34 35# CHECK: addl $-1, %eax36# CHECK: addl $0, %eax37 38.macro fun3 arg1 arg239 addl $\arg1,%eax40 addl $\arg2,%eax41.endm42 43fun3 5<6 , 5>844 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 different49# arguments according to the use of the comma.50# Fun2 sees the comma as a character.51# Fun3 sees the comma as a separator.52 53# CHECK: addl $5, %eax54# CHECK: addl $6, %eax55.macro fun2 arg56 fun3 \arg57.endm58 59fun2 <5,6>60 61# Test #5:62# If argument begin with '<' and there is no '>' to close it.63# A regular macro behavior is expected.64 65# CHECK: addl $4, %eax66.macro fun4 arg1 arg267 .if \arg2\arg168 addl $\arg2,%eax69 .endif70.endm71 72fun4 <5,473.noaltmacro74