MCAsmParser: handle space properly for .ifc/.ifnc

If the strings are not quoted, the first string stops at the first comma, and
the second string stops at the end of the line.  Strings which contain
whitespace should be quoted.  Unquoted space is to be discarded.

llvm-svn: 201985
This commit is contained in:
Saleem Abdulrasool 2014-02-23 15:53:36 +00:00
parent b2ae2c0fd5
commit 5db529852e
2 changed files with 7 additions and 1 deletions

View File

@ -3813,6 +3813,7 @@ bool AsmParser::parseDirectiveIfb(SMLoc DirectiveLoc, bool ExpectBlank) {
/// parseDirectiveIfc
/// ::= .ifc string1, string2
/// ::= .ifnc string1, string2
bool AsmParser::parseDirectiveIfc(SMLoc DirectiveLoc, bool ExpectEqual) {
TheCondStack.push_back(TheCondState);
TheCondState.TheCond = AsmCond::IfCond;
@ -3834,7 +3835,7 @@ bool AsmParser::parseDirectiveIfc(SMLoc DirectiveLoc, bool ExpectEqual) {
Lex();
TheCondState.CondMet = ExpectEqual == (Str1 == Str2);
TheCondState.CondMet = ExpectEqual == (Str1.trim() == Str2.trim());
TheCondState.Ignore = !TheCondState.CondMet;
}

View File

@ -63,3 +63,8 @@
.else
.byte 0
.endif
# CHECK-NOT: .byte 0
# CHECK: .byte 1
.ifnc equal, equal ; .byte 0 ; .else ; .byte 1 ; .endif