-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent __has_builtin
compiler differences from causing divergence
#7836
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
This file contains 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 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,15 @@ | ||
# Snapshot report for `test/test-xsnap.js` | ||
|
||
The actual snapshot is saved in `test-xsnap.js.snap`. | ||
|
||
Generated by [AVA](https://avajs.dev). | ||
|
||
## produce golden snapshot hashes | ||
|
||
> no evaluations | ||
|
||
'91d30e59c1a087d58bb6d8eefcf1262e99e59cfc249222ab25f881ac642437e5' | ||
|
||
> smallish safeInteger multiplication doesn't spill to XS_NUMBER_KIND | ||
|
||
'4b48f6c58c08bb757efd3b8fb21891a386bdc5bfbae6803c8cb7df108e553ace' |
Binary file not shown.
This file contains 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
Oops, something went wrong.
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.
Let's add a note here to remind future test-runners of what we're asserting.
This test snapshot was created from a version of xsnap that was manually observed to avoid the spill (because it has the
__builtin
and can safely tell when it remains within the safe range of integers). We cannot test for the spill/not-spill directly without either parsing thexsnap
heap snapshot, or writing C test code that performs a multiplication and then inspects the.kind
field of the returned value. But we know that any change to the spill/non-spill behavior will change the heap snapshot hash.The snapshot will change (and the test will fail) if either:
It probably can't change in response to the compiler having/not-having the builtins, because the
-D
change means the not-having-builtins cases will simply fail to link, well before we get to this test case. And it won't change in response to the compiler having/not-having__has_builtin()
, because the-D
means we completely ignore the normal__has_builtin()
.So as automated tests go, it's a bit too sensitive to things that 1: will happen, eventually, and 2: aren't what we're trying to assert. That's fine, especially since checking the real thing is too hard, but we should add a note, so when the test fails and the developer is considering ava's
--update-snapshots
, they can tell why this test was using a snapshot in the first place.