- Notifications
You must be signed in to change notification settings - Fork1.7k
C++: Add test that shows that IR generation for<=>
is broken#20068
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
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.
Pull Request Overview
This PR adds a test case that demonstrates broken IR (Intermediate Representation) generation for the three-way comparison operator (<=>
) in C++20. The test reveals that the IR generation process fails to properly handle spaceship operators, resulting in malformed IR with missing operands and broken control flow.
- Adds test code with C++20 three-way comparison operator usage
- Exposes IR generation bugs through both built-in and custom spaceship operators
- Updates expected test outputs to reflect the broken IR state
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
ir.cpp | Adds C++20 test code withstd::strong_ordering implementation and spaceship operator usage |
raw_ir.expected | Shows broken IR generation with incomplete spaceship operator handling |
raw_consistency.expected | Documents IR consistency errors for spaceship operators |
aliased_ssa_consistency_unsound.expected | Records SSA consistency issues with spaceship operators |
aliased_ssa_consistency.expected | Documents aliased SSA consistency problems |
aliased_ir.expected | Shows incomplete IR generation for spaceship operators |
PrintAST.expected | Records AST representation of the new test code |
classThreeWay { | ||
int x; | ||
public: | ||
std::strong_orderingoperator<=>(ThreeWay &y) {returnthis->x <=> y.x; } |
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.
This line contains a three-way comparison operator (<=>). According to the coding guidelines, .ql and .qll files should not be reviewed for code logic, but this appears to be a C++ test file (.cpp) so this guideline may not apply. However, the purpose is to demonstrate broken IR generation, so the implementation serves its intended testing purpose.
Copilot uses AI. Check for mistakes.
9b8302f
intogithub:mainUh oh!
There was an error while loading.Please reload this page.
No description provided.