Skip to content

Commit 84dadda

Browse files
committed
C library: move pthreads related definitions to library
With the support of building initialisers while adding the library we can move library-only symbols to the library. This avoids polluting the initialisation function for all cases that don't actually use pthreads-related library functions. This removal of unused symbols required adding a symbol into the array_of_bool_as_bitvec test, which previously implicitly relied on those library-specific symbols in the patterns being tested for.
1 parent cc701cc commit 84dadda

File tree

34 files changed

+221
-235
lines changed

34 files changed

+221
-235
lines changed

regression/cbmc-concurrency/thread_chain_cbmc1/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
typedef unsigned long thread_id_t;
1919

2020
// Internal unbounded array indexed by local thread identifiers
21-
extern __CPROVER_bool __CPROVER_threads_exited[];
21+
__CPROVER_bool __CPROVER_threads_exited[__CPROVER_constant_infinity_uint];
2222

2323
// A thread_chain is like a chain of threads `f, g, ...` where `f`
2424
// must terminate before `g` can start to run, and so forth.

regression/cbmc-concurrency/thread_chain_cbmc2/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
typedef unsigned long thread_id_t;
1919

2020
// Internal unbounded array indexed by local thread identifiers
21-
extern __CPROVER_bool __CPROVER_threads_exited[];
21+
__CPROVER_bool __CPROVER_threads_exited[__CPROVER_constant_infinity_uint];
2222

2323
// A thread_chain is like a chain of threads `f, g, ...` where `f`
2424
// must terminate before `g` can start to run, and so forth.

regression/cbmc/array_of_bool_as_bitvec/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <stdlib.h>
44

55
__CPROVER_bool w[8];
6+
__CPROVER_bool v[__CPROVER_constant_infinity_uint];
67

78
void main()
89
{

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

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

regression/goto-analyzer/constant_propagation_01/test-vsd.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ main.c
33
--variable-sensitivity --simplify out.gb
44
^EXIT=0$
55
^SIGNAL=0$
6-
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 5, function calls: 0$
7-
^Unmodified: assert: 0, assume: 0, goto: 0, assigns: 12, function calls: 2$
6+
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 2, function calls: 0$
7+
^Unmodified: assert: 0, assume: 0, goto: 0, assigns: 9, function calls: 2$
88
--
99
^warning: ignoring

regression/goto-analyzer/constant_propagation_01/test.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ main.c
33
--constants --simplify out.gb
44
^EXIT=0$
55
^SIGNAL=0$
6-
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 5, function calls: 0$
7-
^Unmodified: assert: 0, assume: 0, goto: 0, assigns: 12, function calls: 2$
6+
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 2, function calls: 0$
7+
^Unmodified: assert: 0, assume: 0, goto: 0, assigns: 9, function calls: 2$
88
--
99
^warning: ignoring

regression/goto-analyzer/constant_propagation_02/test-vsd.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ main.c
33
--variable-sensitivity --simplify out.gb
44
^EXIT=0$
55
^SIGNAL=0$
6-
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 6, function calls: 0$
7-
^Unmodified: assert: 0, assume: 0, goto: 0, assigns: 11, function calls: 2$
6+
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 3, function calls: 0$
7+
^Unmodified: assert: 0, assume: 0, goto: 0, assigns: 8, function calls: 2$
88
--
99
^warning: ignoring

regression/goto-analyzer/constant_propagation_02/test.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ main.c
33
--constants --simplify out.gb
44
^EXIT=0$
55
^SIGNAL=0$
6-
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 6, function calls: 0$
7-
^Unmodified: assert: 0, assume: 0, goto: 0, assigns: 11, function calls: 2$
6+
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 3, function calls: 0$
7+
^Unmodified: assert: 0, assume: 0, goto: 0, assigns: 8, function calls: 2$
88
--
99
^warning: ignoring

regression/goto-analyzer/constant_propagation_03/test-vsd.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ main.c
33
--variable-sensitivity --simplify out.gb
44
^EXIT=0$
55
^SIGNAL=0$
6-
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 6, function calls: 0$
7-
^Unmodified: assert: 0, assume: 0, goto: 0, assigns: 11, function calls: 2$
6+
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 3, function calls: 0$
7+
^Unmodified: assert: 0, assume: 0, goto: 0, assigns: 8, function calls: 2$
88
--
99
^warning: ignoring

regression/goto-analyzer/constant_propagation_03/test.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ main.c
33
--constants --simplify out.gb
44
^EXIT=0$
55
^SIGNAL=0$
6-
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 6, function calls: 0$
7-
^Unmodified: assert: 0, assume: 0, goto: 0, assigns: 11, function calls: 2$
6+
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 3, function calls: 0$
7+
^Unmodified: assert: 0, assume: 0, goto: 0, assigns: 8, function calls: 2$
88
--
99
^warning: ignoring

0 commit comments

Comments
 (0)