-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Suppress testing SemIR in int builtin tests. #4748
Suppress testing SemIR in int builtin tests. #4748
Conversation
Add `EXTRA-ARGS:` support to file_test, to add arguments without overriding the default arguments. Use `EXTRA-ARGS: --no-dump-sem-ir` to turn off SemIR dumping and thus SemIR testing in the int builtin tests, which validate correct behavior through diagnostics instead. This doesn't get us any closer to supporting more targeted SemIR dumping / testing, but hopefully this is a generally useful feature for argument testing. Requested in review of carbon-language#4716.
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.
Nice, I think one suggestion inline about handling RuntimeCall
testing.
fn RuntimeCall(a: i32, b: i32) -> i32 { | ||
return And(a, b); | ||
} |
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.
The SemIR seams still useful, and the only real test we have for the runtime call case. Would it make sense to split the runtime call tests out to files that continue to dump SemIR and only skip it in the ones where we do compile time validation?
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 think the only thing this is testing that's specific to each builtin is that a runtime call is valid. Beside that, the handling is not specific to the particular builtin -- we get the same call SemIR regardless of the kind of builtin -- so I think it's probably good enough to test that only once rather than once per builtin.
To that end, I've gone ahead and added SemIR output coverage for runtime calls to toolchain/check/testdata/function/builtin/call.carbon
(which previously only covered compile-time calls).
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.
Sure... Maybe RuntimeCallIsValid
or something to make that a bit more obvious why there is nothing verified beyond that?
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.
LG!
fn RuntimeCall(a: i32, b: i32) -> i32 { | ||
return And(a, b); | ||
} |
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.
Sure... Maybe RuntimeCallIsValid
or something to make that a bit more obvious why there is nothing verified beyond that?
Add
EXTRA-ARGS:
support to file_test, to add arguments withoutoverriding the default arguments. Use
EXTRA-ARGS: --no-dump-sem-ir
toturn off SemIR dumping and thus SemIR testing in the int builtin tests,
which validate correct behavior through diagnostics instead.
This doesn't get us any closer to supporting more targeted SemIR dumping
/ testing, but this seems to be a generally useful feature anyway. Most existing
tests using
ARGS
have been switched over to usingEXTRA-ARGS
.Requested in review of #4716.