Skip to content

Commit 345f4bf

Browse files
authored
Merge pull request #6590 from tautschnig/link-library-functions
Permit initializers in library functions
2 parents a108335 + d849c8f commit 345f4bf

File tree

100 files changed

+604
-499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+604
-499
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-library/__atomic_always_lock_free-01/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#include <assert.h>
22

3+
#ifndef __GNUC__
4+
_Bool __atomic_always_lock_free(__CPROVER_size_t, void *);
5+
#endif
6+
37
int main()
48
{
59
assert(__atomic_always_lock_free(sizeof(int), 0));

regression/cbmc-library/__atomic_clear-01/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#include <assert.h>
22

3+
#ifndef __GNUC__
4+
void __atomic_clear(_Bool *, int);
5+
#endif
6+
37
int main()
48
{
59
_Bool n;

regression/cbmc-library/__atomic_is_lock_free-01/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#include <assert.h>
22

3+
#ifndef __GNUC__
4+
_Bool __atomic_is_lock_free(__CPROVER_size_t, void *);
5+
#endif
6+
37
int main()
48
{
59
assert(__atomic_is_lock_free(sizeof(int), 0));

regression/cbmc-library/__atomic_signal_fence-01/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#include <assert.h>
22

3+
#ifndef __GNUC__
4+
void __atomic_signal_fence(int);
5+
#endif
6+
37
int main()
48
{
59
__atomic_signal_fence(0);

regression/cbmc-library/__atomic_test_and_set-01/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#include <assert.h>
22

3+
#ifndef __GNUC__
4+
_Bool __atomic_test_and_set(void *, int);
5+
#endif
6+
37
int main()
48
{
59
char c = 0;

regression/cbmc-library/__atomic_thread_fence-01/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#include <assert.h>
22

3+
#ifndef __GNUC__
4+
void __atomic_thread_fence(int);
5+
#endif
6+
37
int main()
48
{
59
__atomic_thread_fence(0);
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#include <assert.h>
22
#include <errno.h>
33

4-
int main()
4+
int main(int arc, char *argv[])
55
{
6-
__errno_location();
7-
assert(0);
6+
// errno expands to use of __errno_location() with glibc
7+
assert(errno == 0);
88
return 0;
99
}

regression/cbmc-library/__errno_location-01/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
CORE
22
main.c
33
--pointer-check --bounds-check
44
^EXIT=0$

0 commit comments

Comments
 (0)