Skip to content

Test argument passing#1105

Merged
rossberg merged 3 commits intoWebAssembly:masterfrom
rianhunter:test-long-argument-list
Nov 24, 2019
Merged

Test argument passing#1105
rossberg merged 3 commits intoWebAssembly:masterfrom
rianhunter:test-long-argument-list

Conversation

@rianhunter
Copy link
Contributor

This change adds tests to make sure passing many arguments across "call" instructions is correct.

@rianhunter
Copy link
Contributor Author

Apparently I'm not affiliated, that's fine. I release this change into the public domain.

Copy link
Member

@rossberg rossberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good. But while you're doing this, why not add one with 100 arguments? That would be a particularly interesting thing to test!

;; Test correct argument passing

(func $return-arg-0-helper (param i32) (result i32)
(local.get 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: consistent indentation (here and below)

@rianhunter
Copy link
Contributor Author

Thanks for reviewing, I'll make those changes!

@rianhunter
Copy link
Contributor Author

Okay I made the changes, just a note, I did not verify if the reference interpreter passed this test.

@rossberg
Copy link
Member

Ah, sorry, that was a misunderstanding. I didn't mean to suggest to enumerate all possible parameter lengths up to 100, just add one test with 100. Enumerating all cases feels like overkill and makes the test file difficult to manoeuvre.

Also, it might be good to make this one "big" call test a bit more diverse and mix different parameter types randomly. That is the kind of thing that compilers tend to have problems with when compiling for different calling conventions.

@rianhunter
Copy link
Contributor Author

Oops yeah that was a bit of a reading comprehension fail on my part. I simplified the PR to a single new test. I removed the other tests because this single test was sufficient for my original purposes while also being interesting enough to have wider applicability.

Copy link
Member

@rossberg rossberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thanks!

@rossberg rossberg merged commit a86b70a into WebAssembly:master Nov 24, 2019
@rianhunter rianhunter deleted the test-long-argument-list branch November 25, 2019 00:17
Copy link

@adligit2 adligit2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants