diff test/MC/AsmParser/altmacro_string_escape.s @ 121:803732b1fca8

LLVM 5.0
author kono
date Fri, 27 Oct 2017 17:07:41 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/MC/AsmParser/altmacro_string_escape.s	Fri Oct 27 17:07:41 2017 +0900
@@ -0,0 +1,29 @@
+# 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>