This is an archive of the discontinued LLVM Phabricator instance.

[mips] Add new error message and improve testing for parsing the .module directive.
ClosedPublic

Authored by tomatabacu on Jan 21 2015, 7:49 AM.

Details

Summary

We used to silently ignore any empty .module's and we used to give an error saying that we found
an "unexpected token at start of statement" when the value of the option wasn't an identifier (e.g. if it was a number).

We now give an error saying that we "expected .module option identifier" in both of those cases.

I also fixed the other tests in mips-abi-bad.s, which all seemed to be broken.

Diff Detail

Event Timeline

tomatabacu updated this revision to Diff 18517.Jan 21 2015, 7:49 AM
tomatabacu retitled this revision from to [mips] Add new error message and improve testing for parsing the .module directive..
tomatabacu updated this object.
tomatabacu edited the test plan for this revision. (Show Details)
tomatabacu added a reviewer: dsanders.
tomatabacu added a subscriber: Unknown Object (MLST).
dsanders accepted this revision.Jan 22 2015, 3:33 AM
dsanders edited edge metadata.

LGTM.

I also fixed the other tests in mips-abi-bad.s, which all seemed to be broken.

Well spotted. They had whitespace before the colon.

Do the '# CHECK-NEXT: ^' lines work as expected? I believe FileCheck ignores most whitespace so we might only be checking that '^' appears somewhere on the line. If it turns out that that's the case I'm happy for stricter whitespace checking to be a follow-up patch.

This revision is now accepted and ready to land.Jan 22 2015, 3:33 AM

You're right, the whitespace is ignored by FileCheck.
Will fix in a follow-up patch.

tomatabacu closed this revision.Jan 23 2015, 2:41 AM