Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/utils/lit/lit/ShUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def lex_arg_quoted(self, delim):
return str
# LLDB uses "$" at the start of global variable names; it should
# not be escaped nor dropped.
elif c == "\\" and self.look() == "$":
elif c == "\\" and self.look() == "$" and delim == '"':
c = self.eat()
str += c
elif c == "\\" and delim == '"':
Expand Down
2 changes: 2 additions & 0 deletions llvm/utils/lit/tests/unit/ShUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def test_quoting(self):
self.assertEqual(self.lex(""" a\\ b """, win32Escapes=True), ["a\\", "b"])
self.assertEqual(self.lex('"\\$y = 11"'), ["$y = 11"])
self.assertEqual(self.lex('"expr \\$y = 11"'), ["expr $y = 11"])
self.assertEqual(self.lex("'\\$y = 11'"), ["\\$y = 11"])
self.assertEqual(self.lex("'expr \\$y = 11'"), ["expr \\$y = 11"])

class TestShParse(unittest.TestCase):
def parse(self, str):
Expand Down