File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -3008,13 +3008,20 @@ bool AsmParser::parseAngleBracketString(std::string &Data) {
3008
3008
}
3009
3009
3010
3010
// / parseDirectiveAscii:
3011
- // / ::= ( .ascii | .asciz | .string ) [ "string" ( , "string" )* ]
3011
+ // ::= .ascii [ "string"+ ( , "string"+ )* ]
3012
+ // / ::= ( .asciz | .string ) [ "string" ( , "string" )* ]
3012
3013
bool AsmParser::parseDirectiveAscii (StringRef IDVal, bool ZeroTerminated) {
3013
3014
auto parseOp = [&]() -> bool {
3014
3015
std::string Data;
3015
- if (checkForValidSection () || parseEscapedString (Data) )
3016
+ if (checkForValidSection ())
3016
3017
return true ;
3017
- getStreamer ().emitBytes (Data);
3018
+ // Only support spaces as separators for .ascii directive for now. See the
3019
+ // discusssion at https://reviews.llvm.org/D91460 for more details.
3020
+ do {
3021
+ if (parseEscapedString (Data))
3022
+ return true ;
3023
+ getStreamer ().emitBytes (Data);
3024
+ } while (!ZeroTerminated && getTok ().is (AsmToken::String));
3018
3025
if (ZeroTerminated)
3019
3026
getStreamer ().emitBytes (StringRef (" \0 " , 1 ));
3020
3027
return false ;
Original file line number Diff line number Diff line change @@ -48,3 +48,11 @@ TEST6:
48
48
TEST7:
49
49
.ascii "\x64\Xa6B"
50
50
.ascii "\xface\x0Fe"
51
+
52
+ # CHECK-LABEL: TEST8:
53
+ # CHECK-NEXT: .byte 65
54
+ # CHECK-NEXT: .byte 66
55
+ # CHECK-NEXT: .byte 67
56
+ # CHECK-NEXT: .byte 68
57
+ TEST8:
58
+ .ascii "A" , "B" "C" , "D"
You can’t perform that action at this time.
0 commit comments