Skip to content

Commit

Permalink
Add further regression test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
mrstanb committed Aug 8, 2023
1 parent 83d2578 commit 79d13cd
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/regression/76-memleak/03-simple-exit-mem-leak.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//PARAM: --set ana.malloc.unique_address_count 1 --set ana.activated[+] memLeak
#include <stdlib.h>

int main(int argc, char const *argv[]) {
int *p = malloc(sizeof(int));
exit(0); //WARN
}
7 changes: 7 additions & 0 deletions tests/regression/76-memleak/04-simple-abort-mem-leak.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//PARAM: --set ana.malloc.unique_address_count 1 --set ana.activated[+] memLeak
#include <stdlib.h>

int main(int argc, char const *argv[]) {
int *p = malloc(sizeof(int));
abort(); //WARN
}
10 changes: 10 additions & 0 deletions tests/regression/76-memleak/05-simple-assert-no-mem-leak.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//PARAM: --set ana.malloc.unique_address_count 1 --set ana.activated[+] memLeak
#include <stdlib.h>
#include <assert.h>

int main(int argc, char const *argv[]) {
int *p = malloc(sizeof(int));
assert(1); //NOWARN
free(p);
return 0; //NOWARN
}
8 changes: 8 additions & 0 deletions tests/regression/76-memleak/06-simple-assert-mem-leak.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//PARAM: --set ana.malloc.unique_address_count 1 --set ana.activated[+] memLeak
#include <stdlib.h>
#include <assert.h>

int main(int argc, char const *argv[]) {
int *p = malloc(sizeof(int));
assert(0); //WARN
}

0 comments on commit 79d13cd

Please sign in to comment.