Skip to content

Commit e98554b

Browse files
committed
Failing test to demonstrate renaming inconsistencies
The mapping from L1 names to types is not in line with the different types used across loop iterations.
1 parent 3a50362 commit e98554b

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

regression/cbmc/vla3/main.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#include <assert.h>
2+
3+
int main(int argc, char *argv[])
4+
{
5+
unsigned char x = argc;
6+
7+
for(int i = 0; i < 3; ++i)
8+
{
9+
struct S
10+
{
11+
int a;
12+
int b[x + i + 1];
13+
int *c;
14+
} __attribute((packed));
15+
16+
struct S s;
17+
18+
for(int j = 0; j < i; ++j)
19+
s.b[x + j] = j;
20+
21+
for(int j = 0; j < i; ++j)
22+
assert(s.b[x + j] == j);
23+
24+
assert(
25+
sizeof(struct S) ==
26+
sizeof(int *) + ((unsigned char)argc + i + 2) * sizeof(int));
27+
}
28+
29+
return 0;
30+
}

regression/cbmc/vla3/test.desc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
KNOWNBUG
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring
9+
--
10+
Renaming is inconsistent across loop iterations as we map L1 names to types, but
11+
do not actually introduce new L1 ids each time we declare an object.

0 commit comments

Comments
 (0)