This is an archive of the discontinued LLVM Phabricator instance.

[mips] Correct tests that are meant to test valid assembly. They were actually rejected by GAS.
ClosedPublic

Authored by dsanders on May 7 2014, 7:32 AM.

Details

Summary

I've noticed a bug in my test generator script that caused 64-bit objects
to be disassembled as if it were using the O32 ABI, giving the wrong register
names. As a result, it generated assembly files that are rejected by GAS when
assembling for the correct ABI. This was caused by the generator setting the
ELF e_flags incorrectly before disassembling the object.

This patch corrects the invalid tests that have already been committed by
replacing the ABI-dependent register names with numeric registers. In addition
to fixing the tests this allows the 32-bit and 64-bit ISA tests to be easily diffed
to produce the invalid-*.s tests which test that instructions defined in later ISA's
are not accepted.

Depends on D3648

Diff Detail

Event Timeline

dsanders updated this revision to Diff 9172.May 7 2014, 7:32 AM
dsanders retitled this revision from to [mips] Correct valid assembly tests..
dsanders updated this object.
dsanders edited the test plan for this revision. (Show Details)
dsanders added a reviewer: vmedic.
vmedic edited edge metadata.May 7 2014, 8:51 AM

Isn't this then a bug in disassembler that should be handled?

No, the disassembler did the right thing for the ELF it was given. My test generator failed to set the e_flags correctly.

vmedic accepted this revision.May 8 2014, 8:11 AM
vmedic edited edge metadata.

The summary should explain the reason for introducing this patch in more details, other then that I find it acceptable.

This revision is now accepted and ready to land.May 8 2014, 8:11 AM
dsanders updated this object.May 8 2014, 8:20 AM
dsanders edited edge metadata.
dsanders updated this object.
dsanders retitled this revision from [mips] Correct valid assembly tests. to [mips] Correct tests that are meant to test valid assembly. They were actually rejected by GAS..May 8 2014, 8:24 AM
dsanders closed this revision.May 8 2014, 8:24 AM

Thanks. Sorry for the confusing description. The references to 'valid assembly tests' were meant to refer to the tests intended to test that valid assembly was accepted. Not that the tests themselves were valid (which they weren't because of the test-generation bug).