-
Notifications
You must be signed in to change notification settings - Fork 745
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
Update lit tests to parse with the new parser #6290
Conversation
Removing support for the legacy syntax will allow us to avoid implementing support for it in the new text parser.
Get as many of the lit tests as possible to parse with the new parser, mostly by moving declared module items to be after imports. Also fix a bug in the new parser's pop validation to allow supertypes of the expected type. The two big issues that still prevent some lit tests from working correctly under the new parser are missing support for symbolic field names and missing support for source map annotations.
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
@@ -1323,7 +1323,7 @@ Result<> IRBuilder::makePop(Type type) { | |||
"pop instructions may only appear at the beginning of catch blocks"}; | |||
} | |||
auto expectedType = scope.exprStack[0]->type; | |||
if (type != expectedType) { | |||
if (!Type::isSubType(expectedType, type)) { |
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.
Shouldn't this be flipped? That is, the seen type should be a subtype of the expected type?
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.
No, in this case if I catch e.g. eqref, it would be valid and safe to overapproximate and have a pop anyref
, but it would not be safe or valid to have pop i31ref
, since the eqref I'm catching may not be an i31ref.
|
||
;; CHECK: (table $0 2 2 funcref) | ||
;; CHECK: (memory $m 1 2) | ||
(memory $m 1 2) |
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.
Why add a name here rather than just move it around?
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.
Just to improve the output ordering. Adding the name doesn't affect whether the new parser can parse it.
@@ -850,7 +850,7 @@ | |||
(func $unreachable-set-2 (param $"{mut:i8}" (ref null $"{mut:i8}")) | |||
;; As above, but the side effects now are a br. Again, the br must happen | |||
;; before the trap (in fact, the br will skip the trap here). | |||
(block | |||
(block $block |
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.
Weird, how did this parse and validate before..?
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.
Because the parser magically assigned the default name "$block" and it happened to match 😆
@@ -24,6 +24,9 @@ | |||
|
|||
;; CHECK: (import "wasm:js-string" "fromCodePoint" (func $fromCodePoint_5 (type $5) (param i32) (result (ref extern)))) | |||
|
|||
;; CHECK: (memory $m 1) | |||
(memory $m 1) |
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.
Why does this test need a memory? I don't seem to see any memory-using instructions.
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.
Hmm, you're right. Will remove.
Get as many of the lit tests as possible to parse with the new parser, mostly by moving declared module items to be after imports. Also fix a bug in the new parser's pop validation to allow supertypes of the expected type. The two big issues that still prevent some lit tests from working correctly under the new parser are missing support for symbolic field names and missing support for source map annotations.
Get as many of the lit tests as possible to parse with the new parser, mostly by
moving declared module items to be after imports. Also fix a bug in the new
parser's pop validation to allow supertypes of the expected type.
The two big issues that still prevent some lit tests from working correctly
under the new parser are missing support for symbolic field names and missing
support for source map annotations.