Skip to content
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

Add tests for switch statements located in action bodies #5122

Open
kfcripps opened this issue Feb 8, 2025 · 1 comment
Open

Add tests for switch statements located in action bodies #5122

kfcripps opened this issue Feb 8, 2025 · 1 comment
Labels
infrastructure Topics related to code style and build and test infrastructure.

Comments

@kfcripps
Copy link
Contributor

kfcripps commented Feb 8, 2025

As mentioned in p4lang/p4-spec#1362, the frontend passes currently produce valid IR for switch statements located in actions, but no tests exist to validate that (as all of the backends run the EliminatteSwitch midend pass, which errors out on switch statements in actions).

It would be nice if we could add tests to validate switch statements in actions somehow.

@kfcripps kfcripps added the infrastructure Topics related to code style and build and test infrastructure. label Feb 8, 2025
@kfcripps
Copy link
Contributor Author

Maybe we don't need to have a test with a P4 program that has switch statements in actions and successfully compiles, because we have an error test for the p4test backend, for which we're still able to observe the output of the frontend passes, before the error occurs: https://github.com/p4lang/p4c/blob/main/testdata/p4_16_errors_outputs/issue3299-frontend.p4

@ChrisDodd @vlstill Do you think this is good enough?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Topics related to code style and build and test infrastructure.
Projects
None yet
Development

No branches or pull requests

1 participant