This is an archive of the discontinued LLVM Phabricator instance.

[AsmParser] Recognize more escaped characters between single quotes
ClosedPublic

Authored by LemonBoy on Mar 30 2021, 10:12 AM.

Details

Summary

The GNU AS manual states the following about single-character constants enclosed within single quotes:

Some backslash escapes apply to characters, \b, \f, \n, \r, \t, and \" with the same meaning as for strings, plus \' for a single quote.

Add two more characters to the switch handling this case to match GAS behaviour, plus a test to make sure nothing regresses.

Diff Detail

Event Timeline

LemonBoy created this revision.Mar 30 2021, 10:12 AM
LemonBoy requested review of this revision.Mar 30 2021, 10:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 30 2021, 10:12 AM
MaskRay accepted this revision.Apr 7 2021, 12:01 PM

LGTM.

llvm/test/MC/AsmParser/directive_values.s
57

Consider CHECK-NEXT:. We want to make sure the parser consumes newlines correctly and does not insert extra newlines.

This revision is now accepted and ready to land.Apr 7 2021, 12:01 PM
LemonBoy updated this revision to Diff 336024.Apr 8 2021, 12:56 AM

Use CHECK-NEXT in more places.

This revision was landed with ongoing or failed builds.Apr 8 2021, 12:59 AM
This revision was automatically updated to reflect the committed changes.