Skip to content

Commit 743b047

Browse files
committed
Regression tests capturing value-set compacting
Simple variable, array element, and field in a structure. They all compact.
1 parent 4248f1b commit 743b047

File tree

6 files changed

+120
-2
lines changed

6 files changed

+120
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FUTURE
1+
CORE
22
main.c
33
--variable-sensitivity --vsd-values set-of-constants --show
44
^EXIT=0$
55
^SIGNAL=0$
66
main::1::a .* value-set-begin: 0, 1, 2, 3, 4, 5, 6 :value-set-end @ \[1, 12, 15, 18, 21, 24, 26\]
77
main::1::b .* value-set-begin: 20, 21, 22, 23, 24 :value-set-end @ \[3, 13, 16, 19, 22\]
8-
main::1::c .* \[14, 1E\] @ \[30\]
8+
main::1::c .* value-set-begin: 24, 25, 26, \[14, 17\], \[1B, 1E\] :value-set-end @ \[30\]
99
--
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#include <stdbool.h>
2+
3+
extern int x;
4+
5+
int main(void)
6+
{
7+
int a[1] = {0};
8+
switch(x)
9+
{
10+
case 1:
11+
a[0] = 1;
12+
break;
13+
case 2:
14+
a[0] = 2;
15+
break;
16+
case 3:
17+
a[0] = 3;
18+
break;
19+
case 4:
20+
a[0] = 4;
21+
break;
22+
case 5:
23+
a[0] = 5;
24+
break;
25+
case 6:
26+
a[0] = 6;
27+
break;
28+
case 7:
29+
a[0] = 7;
30+
break;
31+
case 8:
32+
a[0] = 8;
33+
break;
34+
case 9:
35+
a[0] = 9;
36+
break;
37+
case 10:
38+
a[0] = 10;
39+
break;
40+
case 11:
41+
a[0] = 11;
42+
break;
43+
case 12:
44+
a[0] = 12;
45+
break;
46+
}
47+
48+
return 0;
49+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
main.c
3+
--variable-sensitivity --vsd-values set-of-constants --vsd-arrays every-element --show
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
main::1::a .* value-set-begin: 4, 5, 6, 11, 12, \[0, 3\], \[7, A\] :value-set-end @ \[1, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38\]
7+
--
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#include <stdbool.h>
2+
3+
extern int x;
4+
5+
struct S
6+
{
7+
int a;
8+
};
9+
10+
int main(void)
11+
{
12+
struct S a;
13+
a.a = 0;
14+
switch(x)
15+
{
16+
case 1:
17+
a.a = 1;
18+
break;
19+
case 2:
20+
a.a = 2;
21+
break;
22+
case 3:
23+
a.a = 3;
24+
break;
25+
case 4:
26+
a.a = 4;
27+
break;
28+
case 5:
29+
a.a = 5;
30+
break;
31+
case 6:
32+
a.a = 6;
33+
break;
34+
case 7:
35+
a.a = 7;
36+
break;
37+
case 8:
38+
a.a = 8;
39+
break;
40+
case 9:
41+
a.a = 9;
42+
break;
43+
case 10:
44+
a.a = 10;
45+
break;
46+
case 11:
47+
a.a = 11;
48+
break;
49+
case 12:
50+
a.a = 12;
51+
break;
52+
}
53+
54+
return 0;
55+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
main.c
3+
--variable-sensitivity --vsd-values set-of-constants --vsd-structs every-field --show
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
main::1::a .* \{.a=value-set-begin: 4, 5, 6, 11, 12, \[0, 3\], \[7, A\] :value-set-end @ \[1, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38\]\} .*
7+
--

0 commit comments

Comments
 (0)