This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Add some tests for wasm MC layer
ClosedPublic

Authored by sbc100 on Apr 26 2017, 2:12 PM.

Details

Summary

Also, modify readobj such that addends are only emitted for
relevant relocation types.

Diff Detail

Repository
rL LLVM

Event Timeline

sbc100 created this revision.Apr 26 2017, 2:12 PM
sbc100 updated this revision to Diff 96819.Apr 26 2017, 2:14 PM
  • Add sections test
dschuff added inline comments.Apr 26 2017, 2:54 PM
test/MC/WebAssembly/reloc-code.ll
1 ↗(On Diff #96819)

Is there any particular reason this needs to be O0?

30 ↗(On Diff #96819)

Can we add a test with a non-0 addend? I guess negative too now that we have support for that.

sbc100 updated this revision to Diff 97026.Apr 27 2017, 5:22 PM
  • Merge remote-tracking branch 'origin/master' into add_tests
  • Only emit addends for relevant relocations
sbc100 edited the summary of this revision. (Show Details)Apr 27 2017, 5:25 PM
sbc100 marked an inline comment as done.
sbc100 added inline comments.
test/MC/WebAssembly/reloc-code.ll
30 ↗(On Diff #96819)

I have trouble getting llvm to produce non-zero data relocations in the text section. I think when I add the tests for the data sections relocations it will be possible. Perhaps @sunfish knows more about this, but I'd like to land this soon to get some minimal testing in.

dschuff accepted this revision.Apr 27 2017, 5:34 PM

That's fine, this is obviously an improvement, i just noticed that they were all 0 in the tests.

This revision is now accepted and ready to land.Apr 27 2017, 5:34 PM
This revision was automatically updated to reflect the committed changes.