llvm-mirror/test/MC/AsmParser/hash-directive.s
Nirav Dave 459830f670 Refactor and cleanup Assembly Parsing / Lexing
Recommiting after fixing non-atomic insert to front of SmallVector in
MCAsmLexer.h

Add explicit Comment Token in Assembly Lexing for future support for
outputting explicit comments from inline assembly. As part of this,
CPPHash Directives are now explicitly distinguished from Hash line
comments in Lexer.

Line comments are recorded as EndOfStatement tokens, not Comment tokens
to simplify compatibility with current TargetParsers. This slightly
complicates comment output.

This remove all lexing tasks out of the parser, does minor cleanup
to remove extraneous newlines Asm Output, and some improvements white
space handling.

Reviewers: rtrieu, dwmw2, rnk

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D20009

llvm-svn: 273007
2016-06-17 16:06:17 +00:00

24 lines
638 B
ArmAsm

# RUN: not llvm-mc -triple i386-unknown-unknown %s 2>&1 | FileCheck %s
error
# CHECK: hash-directive.s:[[@LINE-1]]:1: error
# 3 "FILE1" 1 #<- This is a CPP Hash w/ comment
error
# CHECK: FILE1:3:1: error
# 0 "" 2 #<- This is too
error
# CHECK: hash-directive.s:[[@LINE-1]]:1: error
# 1 "FILE2" 2 #<- This is a comment
error
# CHECK: hash-directive.s:[[@LINE-1]]:1: error
nop; # 6 "FILE3" 2 #<- This is a still comment
error
# CHECK: hash-directive.s:[[@LINE-1]]:1: error
nop;# 6 "FILE4" 2
nop;
error
# CHECK: FILE4:7:1: error
# 0 "" 2
/*comment*/# 6 "FILE5" 2 #<- This is a comment
error
# CHECK: hash-directive.s:[[@LINE-1]]:1: error