mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-12 14:41:05 +00:00
0456ea13b1
This patch is the fourth patch in a series of reviews for the Altmacro feature. This patch introduces a new escape character '!' and it depends on D32701. according to https://sourceware.org/binutils/docs/as/Altmacro.html: "single-character string escape To include any single character literally in a string (even if the character would otherwise have some special meaning), you can prefix the character with !' (an exclamation mark). For example, you can write <4.3 !> 5.4!!>' to get the literal text `4.3 > 5.4!'. " Differential Revision: https://reviews.llvm.org/D32792 llvm-svn: 302652
30 lines
603 B
ArmAsm
30 lines
603 B
ArmAsm
# RUN: llvm-mc -triple i386-linux-gnu %s| FileCheck %s
|
|
|
|
.altmacro
|
|
# single-character string escape
|
|
# To include any single character literally in a string
|
|
# (even if the character would otherwise have some special meaning),
|
|
# you can prefix the character with `!'.
|
|
# For example, you can write `<4.3 !> 5.4!!>' to get the literal text `4.3 > 5.4!'.
|
|
|
|
# CHECK: workForFun:
|
|
.macro fun1 number
|
|
.if \number=5
|
|
lableNotWork:
|
|
.else
|
|
workForFun:
|
|
.endif
|
|
.endm
|
|
|
|
# CHECK: workForFun2:
|
|
.macro fun2 string
|
|
.if \string
|
|
workForFun2:
|
|
.else
|
|
notworkForFun2:
|
|
.endif
|
|
.endm
|
|
|
|
fun1 <5!!>
|
|
fun2 <5!>4>
|