Skip to content

Commit d2eea3b

Browse files
committed
Improves regression tests for posix_memalign
Signed-off-by: Felipe R. Monteiro <[email protected]>
1 parent 390880e commit d2eea3b

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
CORE
22
main.c
3-
--pointer-check --bounds-check
3+
--pointer-check --bounds-check --malloc-may-fail --malloc-fail-null
44
VERIFICATION SUCCESSFUL
55
^EXIT=0$
66
^SIGNAL=0$
77
--
8-
^\*\*\*\* WARNING: no body for function posix_memalign
8+
^warning: ignoring
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include <stdlib.h>
2+
#include <string.h>
3+
4+
int main()
5+
{
6+
size_t size = 4;
7+
size_t page_size = 4096;
8+
void *src = "testing";
9+
void *dest;
10+
posix_memalign(&dest, page_size, size);
11+
memcpy(dest, src, size);
12+
return 0;
13+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
main.c
3+
--pointer-check --bounds-check --malloc-may-fail --malloc-fail-null
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^VERIFICATION FAILED$
7+
\[main.precondition_instance.1\] .* memcpy src/dst overlap: FAILURE
8+
\[main.precondition_instance.3\] .* memcpy destination region writeable: FAILURE
9+
\*\* 2 of 14 failed
10+
--
11+
^warning: ignoring

0 commit comments

Comments
 (0)