mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-03 01:12:59 +00:00
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:
parent
a0d16299c9
commit
0922e5b643
@ -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;
|
||||
}
|
||||
|
||||
|
@ -63,3 +63,8 @@
|
||||
.else
|
||||
.byte 0
|
||||
.endif
|
||||
|
||||
# CHECK-NOT: .byte 0
|
||||
# CHECK: .byte 1
|
||||
.ifnc equal, equal ; .byte 0 ; .else ; .byte 1 ; .endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user