Skip to content

Commit 6eb5990

Browse files
Add more tests.
Add a test to make sure that we can distinguish between a parameter and a global function pointer variable with the same name and a test to make sure that we get different type constructors for the same type but with extra attributes.
1 parent 8266009 commit 6eb5990

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
void entry_point(int *array_with_size, int size, int *array_without_size)
2+
{
3+
assert(array_with_size != (void *)0);
4+
assert(array_with_size != (void *)0);
5+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
test.c
3+
--function entry_point --harness-type call-function --associated-array-size array_with_size:size
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
call to '\w+': not enough arguments, inserting non-deterministic value
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include <assert.h>
2+
3+
typedef int (*fptr_t)(void);
4+
5+
fptr_t f;
6+
7+
int call_f()
8+
{
9+
assert(f != ((void *)0));
10+
return f();
11+
}
12+
13+
void function(fptr_t f)
14+
{
15+
if(f != ((void *)0))
16+
assert(f() == call_f());
17+
assert(f != ((void *)0));
18+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
test.c
3+
--harness-type call-function --function function --function-pointer-can-be-null function::f
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
\[function.assertion.1\] line \d+ assertion f\(\) == call_f\(\): SUCCESS
7+
\[function.assertion.2\] line \d+ assertion f != \(\(void \*\)0\): FAILURE
8+
\[call_f.assertion.1\] line \d+ assertion f != \(\(void \*\)0\): SUCCESS
9+
--
10+
^warning: ignoring

0 commit comments

Comments
 (0)