Skip to content

Commit 0723271

Browse files
committed
Tests: use types that are smaller than long on all platforms
Some tests assumed that sizeof(int) < sizeof(long), which need not be the case.
1 parent a9ca74e commit 0723271

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

regression/cbmc/array_of_bool_as_bitvec/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void main()
1111
__CPROVER_bool y[8] = {false};
1212
bool *z = calloc(8, sizeof(bool));
1313

14-
unsigned idx;
14+
unsigned char idx;
1515
__CPROVER_assume(0 <= idx && idx < 8);
1616

1717
assert(w[idx] == x[idx]);

regression/cbmc/array_of_bool_as_bitvec/test-smt2-outfile.desc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ CORE broken-smt-backend
22
main.c
33
--smt2 --outfile -
44
\(= \(select array_of\.0 i\) \(ite false #b1 #b0\)\)
5-
\(= \(select array\.1 \(\(_ zero_extend 32\) \|main::1::idx!0@1#1\|\)\) #b1\)
6-
\(= \(select array\.1 \(_ bv\d+ 64\)\) \(ite false #b1 #b0\)\)
5+
\(= \(select array\.1 \(\(_ zero_extend \d+\) \|main::1::idx!0@1#1\|\)\) #b1\)
6+
\(= \(select array\.1 \(_ bv\d+ \d+\)\) \(ite false #b1 #b0\)\)
77
^EXIT=0$
88
^SIGNAL=0$
99
--
1010
\(= \(select array_of\.0 i\) false\)
11-
\(= \(select array\.1 \(\(_ zero_extend 32\) \|main::1::idx!0@1#1\|\)\) #b1 #b0\)
12-
\(= \(select array\.1 \(_ bv\d+ 64\)\) false\)
11+
\(= \(select array\.1 \(\(_ zero_extend \d+\) \|main::1::idx!0@1#1\|\)\) #b1 #b0\)
12+
\(= \(select array\.1 \(_ bv\d+ \d+\)\) false\)
1313
--
1414
This test checks for correctness of BitVec-array encoding of Boolean arrays.
1515

regression/cbmc/ptr_arithmetic_on_null/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ void main()
55
assert(NULL != (NULL + 1));
66
assert(NULL != (NULL - 1));
77

8-
int offset;
8+
signed char offset;
99
__CPROVER_assume(offset != 0);
1010
assert(NULL != (NULL + offset));
1111

regression/cbmc/ptr_arithmetic_on_null/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ main.c
33

44
^\[main.assertion.1\] line .* assertion \(\(char \*\)NULL\) != \(char \*\)\(void \*\)0 \+ (\(.*\))?1: SUCCESS$
55
^\[main.assertion.2\] line .* assertion \(\(char \*\)NULL\) != \(char \*\)\(void \*\)0 - (\(.*\))?1: SUCCESS$
6-
^\[main.assertion.3\] line .* assertion \(\(char \*\)NULL\) != \(char \*\)\(void \*\)0 \+ (\(.*\))?offset: SUCCESS$
6+
^\[main.assertion.3\] line .* assertion \(\(char \*\)NULL\) != \(char \*\)\(void \*\)0 \+ \(.*\)offset: SUCCESS$
77
^\[main.assertion.4\] line .* assertion \(char \*\)\(void \*\)0 - \(char \*\)\(void \*\)0 == (\(.*\))?0: SUCCESS$
88
^\[main.assertion.5\] line .* assertion ptr - \(signed int \*\)\(void \*\)0 == (\(.*\))?0: FAILURE$
99
^\[main.assertion.6\] line .* assertion \(ptr - (\(.*\))?1\) \+ (\(.*\))?1 == \(\(.* \*\)NULL\): SUCCESS$

0 commit comments

Comments
 (0)