This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Update test cases after FixFunctionBitcasts
ClosedPublic

Authored by aheejin on Nov 3 2018, 3:16 AM.

Details

Summary

This updates generated binaries and corresponding test cases up to date
after applying FixFunctionBitcasts pass.

Diff Detail

Repository
rL LLVM

Event Timeline

aheejin created this revision.Nov 3 2018, 3:16 AM
aheejin edited the summary of this revision. (Show Details)Nov 3 2018, 3:22 AM
aheejin added a comment.EditedNov 3 2018, 3:33 AM

This does not update these 'invalid' test cases:

test/tools/llvm-objdump/Inputs/corrupt-section.wasm
test/Object/Inputs/WASM/missing-version.wasm
test/Object/Inputs/WASM/string-outside-section.wasm

Because it is unclear how to regenerate these invalid test cases. Do you think we should regenerate them? If so, how? @sbc100

sbc100 added a comment.Nov 5 2018, 9:32 AM

Hmm.. just to be clear, these tests are not failing on HEAD are they?

Why not just leave them as is?

Also, I've had some fallout from the change to enable the main wrappers by default so I think we should perhaps revert it. Specifically the test_mainenv test in emscripten is failing because it expects envp to be set to null, not some undefined value (which happens to be non-null right now).

aheejin updated this revision to Diff 172652.Nov 5 2018, 2:11 PM
  • Update test cases on top of D54117

Hmm.. just to be clear, these tests are not failing on HEAD are they?

Before test/Object/Inputs/WASM/string-outside-section.wasm failed after I added the event section, but maybe it is because I reassigned section number incorrectly.

Why not just leave them as is?

Yes I'm gonna leave them as is for now.

Also, I've had some fallout from the change to enable the main wrappers by default so I think we should perhaps revert it. Specifically the test_mainenv test in emscripten is failing because it expects envp to be set to null, not some undefined value (which happens to be non-null right now).

I rebased this CL on top of D54117. We apparently still have something to update because of FixFunctionBitCasts on SomeOtherFunction.

aheejin retitled this revision from [WebAssembly] Update test cases after main wrapper generation to [WebAssembly] Update test cases after FixFunctionBitcasts.Nov 5 2018, 2:16 PM
aheejin edited the summary of this revision. (Show Details)
sbc100 added a comment.Nov 5 2018, 4:31 PM

Its not clear to me that we should regenerate these binaries every time a change to llvm means the binary would change. These test inputs remain valid even if llvm would no longer that same file bit-for-bit.

aheejin abandoned this revision.Nov 6 2018, 1:41 AM

I wasn't planning on regenerating test binaries every time; the reason I did this patch was, after I incorrectly changed section numbers (by making the event section 7 and shifting all later sections by 1), I had to regenerate test binaries, and accidentally all these FixFunctionBitCast changes were included in that CL. Anyway, after I reassigned the correct section number (12) to the event section, I don't need to update binary tests anymore there so I don't need this CL either. Thanks!

aheejin reclaimed this revision.EditedNov 6 2018, 2:29 AM

Hmm, come to think about it, maybe it's better to update the binaries here and in D54096 after all, because D54096 adds a new section. (I'm not planning on updating these every time we change something on binaries) The reason is, for example, if I want to see if the event section code (0xC) is correctly printed in this test, I have to update binaries. And if I update binaries only in D54096 and abandon this CL, these changes from FixFunctionBitCasts will be all included in that CL, which I don't want.

sbc100 accepted this revision.Nov 6 2018, 9:53 AM
This revision is now accepted and ready to land.Nov 6 2018, 9:53 AM
This revision was automatically updated to reflect the committed changes.