1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
llvm-mirror/test/MC/AsmParser/negative_altmacro_string.s
Michael Zuckerman 49a4a4a7b6 [LLVM][inline-asm][Altmacor] Altmacro string delimiter '<..>'
In this patch, I introduce a new altmacro string delimiter. 
This review is the second review in a series of four reviews.
(one for each altmacro feature: LOCAL, string delimiter, string '!' escape sign and absolute expression as a string '%' ).

In the alternate macro mode, you can delimit strings with matching angle brackets <..> 
when using it as a part of calling macro arguments.

As described in the https://sourceware.org/binutils/docs-2.27/as/Altmacro.html
"<string>
You can delimit strings with matching angle brackets."

assumptions:

1. If an argument begins with '<' and ends with '>'. The argument is considered as a string.
2. Except adding new string mark '<..>', a regular macro behavior is expected.
3. The altmacro cannot affect the regular less/greater behavior.
4. If a comma is present inside an angle brackets it considered as a character and not as a separator.

Differential Revision: https://reviews.llvm.org/D32701

llvm-svn: 302135
2017-05-04 10:37:00 +00:00

30 lines
825 B
ArmAsm

# RUN: not llvm-mc -triple i386-linux-gnu %s 2>&1 | FileCheck %s
# This test checks the altmacro string delimiter '<' and '>'.
# In this test we check the '.noaltmacro' directive.
# We expect that '.altmacro' and '.noaltmacro' will act as a switch on/off directives to the alternate macro mode.
# .noaltmacro returns the format into a regular macro handling.
# The default mode is ".noaltmacro".
# Test #1: default mode
# CHECK: error: unexpected token at start of statement
# CHECK-NEXT: <simpleCheck>:
.macro simple_check_0 name
\name:
.endm
simple_check_0 <simpleCheck>
.altmacro
.noaltmacro
# Test #2: Switching from alternate mode to default mode
# CHECK: error: unexpected token at start of statement
# CHECK-NEXT: <simpleCheck1>:
.macro simple_check_1 name
\name:
.endm
simple_check_1 <simpleCheck1>