-
Notifications
You must be signed in to change notification settings - Fork 274
add three tests for unions in structs #7278
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
Conversation
Codecov ReportBase: 78.03% // Head: 78.03% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## develop #7278 +/- ##
========================================
Coverage 78.03% 78.03%
========================================
Files 1624 1624
Lines 187405 187405
========================================
Hits 146249 146249
Misses 41156 41156 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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 don't mind seeing this merged, but maybe we just want to fix the issues right away?
regression/cbmc/union/union_member.c
Outdated
#include <assert.h> | ||
|
||
struct s { | ||
union U { | ||
char b[2]; | ||
}; | ||
}; | ||
|
||
int main() { | ||
struct s X; | ||
__CPROVER_assert(X.b[1] == 2, "should fail"); | ||
} |
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.
Won't fail anymore with #7230, but even now only fails with z3. Works fine with the in-tree SMT solver.
regression/cbmc/union/union_update.c
Outdated
#include <assert.h> | ||
|
||
struct s { | ||
char a; | ||
union U { | ||
char c; | ||
char b[2]; | ||
} u; | ||
} X = { 1, 2 }; | ||
|
||
int main() { | ||
__CPROVER_assert(X.u.b[1] == 123, "should fail"); | ||
} |
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.
Only fails with z3, works fine with the in-tree SMT solver.
These tests pass with the built-in solver but fail with three different errors when using SMT.
These tests pass with the built-in solver but fail with three different errors when using SMT.