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

KNOWNBUG test for enum-range check inside LHS of an assignment #8543

Merged
merged 1 commit into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions regression/cbmc/enum_is_in_range/enum_lhs.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
typedef enum my_enum
{
A = 1,
B = 2
};
int my_array[10];

int main()
{
// should fail
(enum my_enumt)3;

// should fail
my_array[(enum my_enumt)4] = 10;

return 0;
}
11 changes: 11 additions & 0 deletions regression/cbmc/enum_is_in_range/enum_lhs.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
KNOWNBUG
enum_lhs.c
--enum-range-check
^\[main\.enum-range-check\.2\] line 14 enum range check in \(my_enumt\)4: FAILURE$
^EXIT=10$
^SIGNAL=0$
--
--
The conversion to enum on the LHS should fail the enum-range check, but
doesn't.

Loading