This repository was archived by the owner on Jun 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 199
Print return values of run tests if type is not boolean. #1231
Closed
Closed
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
18afb26
Add print and assertion options to the run tests.
krk b5cc84a
Revert verifier errors format string.
krk 892a6b0
Implement FromStr for Operator.
krk 5e78a80
Add function name to errors.
krk 0e1b3de
Remove some return keywords.
krk ba49813
Refactor print_only parameter of check into a new print function.
krk 62084b5
Add Value enum to represent parsed values in function_runner.
krk 3405df7
Comment test failing in Windows, issue at #1279.
krk e7d02ea
Fix commented run command in test.
krk 51c2e53
Substitute single line macro "consume".
krk 0c9942c
Remove boolean_to_vec function and simplify its only callsite.
krk 3a57022
Use ConstantData less in parsing test options.
krk 6875284
Remove unnecessary type condition in FunctionRunner.invoke.
krk b076b68
Do not compile method that cannot be run in test.
krk 02d887c
Fix return value count error message.
krk 350c755
Simplify return type check for two I64s.
krk d772f3e
Remove unnecessary trivial_numeric_casts attribute.
krk 7dc5f43
Merge use declarations.
krk 7ec2f56
Remove overflowing_shl.
krk 059ffcc
Mark invoke function as unsafe.
krk 32d94ec
Remove unnecessary return.
krk bd443f8
Add descriptive panic message.
krk 0be5b8d
Reword error message.
krk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| test run | ||
| target x86_64 | ||
|
|
||
| function %test_assert_equal() -> i64 { | ||
| ebb0: | ||
| v0 = iconst.i64 42 | ||
| return v0 | ||
| } | ||
|
|
||
| ; run: %fn() == 0x2a | ||
|
|
||
| function %test_assert_inequal() -> i64 { | ||
| ebb0: | ||
| v0 = iconst.i64 0 | ||
| return v0 | ||
| } | ||
|
|
||
| ; run: %fn() != 0x2a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| test run | ||
| target x86_64 | ||
|
|
||
| function %test_i8() -> i8 { | ||
| ebb0: | ||
| v0 = iconst.i8 42 | ||
| return v0 | ||
| } | ||
| ; run: %fn() == 0x2a | ||
|
|
||
| function %test_i16() -> i16 { | ||
| ebb0: | ||
| v0 = iconst.i16 42 | ||
| return v0 | ||
| } | ||
| ; run: %fn() == 0x2a | ||
|
|
||
| function %test_i32() -> i32 { | ||
| ebb0: | ||
| v0 = iconst.i32 42 | ||
| return v0 | ||
| } | ||
| ; run: %fn() == 0x2a | ||
|
|
||
| function %test_i64() -> i64 { | ||
| ebb0: | ||
| v0 = iconst.i64 0x4242_3535_1234_5678 | ||
| return v0 | ||
| } | ||
| ; run: %fn() == 0x4242_3535_1234_5678 | ||
|
|
||
| ; Multi-value return does not work on Windows ABI, for details see #1279. | ||
| ; function %test_i128() -> i128 { | ||
| ; ebb0: | ||
| ; v0 = iconst.i64 0x4242_3535_1234_5678 | ||
| ; v1 = iconst.i64 0xabcd_ef01_beef_b411 | ||
| ; v2 = iconcat v0, v1 | ||
| ; return v2 | ||
| ; } | ||
| ; ; r-u-n: %fn() == 0x4242_3535_1234_5678_abcd_ef01_beef_b411 | ||
|
|
||
| function %test_b1() -> b1 { | ||
| ebb0: | ||
| v0 = bconst.b1 true | ||
| return v0 | ||
| } | ||
| ; run: %fn() == true | ||
|
|
||
| function %test_b8() -> b8 { | ||
| ebb0: | ||
| v0 = bconst.b8 true | ||
| return v0 | ||
| } | ||
| ; run: %fn() == true | ||
|
|
||
| function %test_b16() -> b16 { | ||
| ebb0: | ||
| v0 = bconst.b16 true | ||
| return v0 | ||
| } | ||
| ; run: %fn() == true | ||
|
|
||
| function %test_b32() -> b32 { | ||
| ebb0: | ||
| v0 = bconst.b32 true | ||
| return v0 | ||
| } | ||
| ; run: %fn() == true | ||
|
|
||
| function %test_b64() -> b64 { | ||
| ebb0: | ||
| v0 = bconst.b64 true | ||
| return v0 | ||
| } | ||
| ; run: %fn() == true | ||
|
|
||
| function %test_f32() -> f32 { | ||
| ebb0: | ||
| v0 = f32const 0x1.23 | ||
| return v0 | ||
| } | ||
| ; run: %fn() == 0x1.23 | ||
|
|
||
| function %test_f64() -> f64 { | ||
| ebb0: | ||
| v0 = f64const 0x1000.0001 | ||
| return v0 | ||
| } | ||
| ; run: %fn() == 0x1000.0001 | ||
bnjbvr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that moving that parsing code into this
cranelift-readercrate would let us avoid making all these methods public as well.