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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201985 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Saleem Abdulrasool 2014-02-23 15:53:36 +00:00
parent a0d16299c9
commit 0922e5b643
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