Skip to content

Commit a531153

Browse files
committed
CBMC library regression tests: ensure GNUC-only declarations are present
MSVC won't have the built-in declarations available, and will thus fail type checking.
1 parent a108335 commit a531153

File tree

8 files changed

+30
-2
lines changed

8 files changed

+30
-2
lines changed

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);

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

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

3+
#ifndef __GNUC__
4+
# define _longjmp(a, b) longjmp(a, b)
5+
#endif
6+
37
static jmp_buf env;
48

59
int main()

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
CORE
22
main.c
33
--pointer-check --bounds-check
4-
^\[_longjmp.assertion.1\] line 12 _longjmp requires instrumentation: FAILURE$
5-
^\[main.assertion.1\] line 8 unreachable: SUCCESS$
4+
^\[_?longjmp.assertion.1\] line 12 _?longjmp requires instrumentation: FAILURE$
5+
^\[main.assertion.1\] line 12 unreachable: SUCCESS$
66
^VERIFICATION FAILED$
77
^EXIT=10$
88
^SIGNAL=0$

0 commit comments

Comments
 (0)