Skip to content

Conversation

@bricknerb
Copy link
Contributor

@bricknerb bricknerb commented Jun 11, 2025

Follow up of #5594.

Trying to compromise SemIR size, having enough information and complexity of tests, I've duplicated representative tests to a separate test file with --dump-sem-ir-ranges=if-present.

…on` and `toolchain/check/testdata/interop/cpp/function_return.carbon` tests to use sem ir ranges
…mIR for cases intended to fail.

Keep one successful case with full SemIR.
@bricknerb bricknerb marked this pull request as ready for review June 11, 2025 14:17
@github-actions github-actions bot requested a review from jonmeow June 11, 2025 14:18
Comment on lines 46 to 47
//@dump-sem-ir-begin
//@dump-sem-ir-end
Copy link
Contributor

@jonmeow jonmeow Jun 11, 2025

Choose a reason for hiding this comment

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

Why not use ranges=only? If there are tests that you're intentionally trying to get full SemIR for, can you perhaps split them out to a separate file to make it more apparent?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for moving the Full SemIR tests in a separate file.

That will make it easier to adapt that test only for the purpose of testing the SemIR output and make it more apparent what we want to have there. For example we can also skip the int param test and keep only one for the params. I'd still keep existing tests as they are and make them dedicated to type mapping.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

Choose a reason for hiding this comment

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

How about having only one file for the Full SemIR tests? (e.g. function_semir.carbon)

I think that in general we don't need a full SemIR test for each of the param types, only one is enough (similar to what you do for the return types). I'd also add a Carbon function with the same signature there, to be able to compare the SemIR for the C++ and Carbon functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.
I've kept full_semir in the filename though, since other files also have SemIR but this file has the full SemIR so I thought it would be clearer.
Let me know if you want me to remove the full_ part :)

Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW, there's a "function" subdirectory, you could consider moving it there to be `function/full_semir.carbon" instead of "function_full_semir.carbon". Similar with params. But, this is an idle comment -- I'm happy with the PR as-is, just can't merge it due to conflicts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!
I think I'll move files to under function dir in a separate PR.
This is a follow up of not having the no_prelude dir.

Copy link
Contributor

@ivanaivanovska ivanaivanovska left a comment

Choose a reason for hiding this comment

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

How about having only one file for the Full SemIR tests? (e.g. function_semir.carbon)

I think that in general we don't need a full SemIR test for each of the param types, only one is enough (similar to what you do for the return types). I'd also add a Carbon function with the same signature there, to be able to compare the SemIR for the C++ and Carbon functions.

@bricknerb bricknerb requested a review from ivanaivanovska June 17, 2025 12:39
Copy link
Contributor

@jonmeow jonmeow left a comment

Choose a reason for hiding this comment

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

LG, thanks!

@bricknerb bricknerb enabled auto-merge June 18, 2025 07:43
@bricknerb bricknerb added this pull request to the merge queue Jun 18, 2025
Merged via the queue into carbon-language:trunk with commit 64ad57a Jun 18, 2025
8 checks passed
@bricknerb bricknerb deleted the ranges4 branch June 18, 2025 07:59
bricknerb added a commit to bricknerb/carbon-lang that referenced this pull request Jun 24, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jun 24, 2025
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