-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename folder numbers from 99 98 to 86 85
- Loading branch information
1 parent
75d4a48
commit 1c3ab72
Showing
18 changed files
with
135 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// SKIP PARAM: --enable ana.int.interval --set ana.activated[+] apron | ||
// This test checks the no overflow computation in apron | ||
int main() | ||
{ | ||
unsigned int len = rand(); | ||
len = len % 10; | ||
int top; | ||
for (int i = 0; 1 - (i - 1 < len) < 1; i++) // raises both both branch dead if no_overflow is wrong computed | ||
{ | ||
int tmp = i; | ||
} | ||
|
||
return 0; | ||
} |
14 changes: 7 additions & 7 deletions
14
.../97-relational-malloc/01-random-simples.c → .../85-relational-malloc/01-random-simples.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
// PARAM: --set ana.activated[+] memOutOfBounds --enable ana.int.interval --set ana.activated[+] apron --set ana.apron.domain polyhedra | ||
// PARAM: --set ana.activated[+] memOutOfBounds --enable ana.int.interval --set ana.activated[+] apron --set ana.apron.domain polyhedra | ||
|
||
#include <stdlib.h> | ||
|
||
char *arr; | ||
int main() | ||
{ | ||
int len = rand(); | ||
unsigned int len = rand(); | ||
|
||
char *arr; | ||
arr = malloc(sizeof(char) * len); | ||
|
||
for (int i = 0; i < len; i++) | ||
for (int i = 0; (unsigned int)i < len; i++) | ||
{ | ||
char tmp = *(arr); // NOWARN | ||
arr[i] = 42; // NOWARN | ||
arr[i] = 42; // NOWARN | ||
arr[i + 1] = 127; // WARN | ||
arr[i - 1] = 42; // WARN | ||
arr[i - 1] = 42; // WARN | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
...on/97-relational-malloc/05-multi-thread.c → ...on/85-relational-malloc/05-multi-thread.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,5 +24,6 @@ int main() | |
} | ||
*(t + 1) = 2; // NOWARN | ||
*(t + i) = 2; // WARN | ||
*(t+len) =2; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
44 changes: 44 additions & 0 deletions
44
tests/regression/85-relational-malloc/12-pointer-tracking-multi-thread.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// PARAM: --set ana.activated[+] memOutOfBounds --set ana.activated[+] threadJoins --set ana.activated[+] apron --set ana.apron.domain polyhedra --enable ana.int.interval --set ana.activated[+] taintPartialContexts --set ana.activated[+] thread --enable ana.apron.pointer_tracking --set sem.int.signed_overflow assume_none --disable warn.integer | ||
#include <stdlib.h> | ||
#include <stdio.h> | ||
#include <pthread.h> | ||
|
||
int *gptr; | ||
|
||
pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER; | ||
|
||
void *t_other(int *len) | ||
{ | ||
pthread_mutex_lock(&mtx); | ||
int tmp = *gptr; // WARN | ||
pthread_mutex_unlock(&mtx); | ||
} | ||
|
||
int main() | ||
{ | ||
int len = rand(); | ||
len %= 10; | ||
gptr = malloc(sizeof(int) * len); | ||
|
||
pthread_t thread; | ||
pthread_create(&thread, NULL, t_other, NULL); | ||
|
||
pthread_mutex_lock(&mtx); | ||
int x = 0; | ||
int *p = gptr; | ||
while (x < len) | ||
{ | ||
*p = 42; // NOWARN | ||
*(p + 1) = 42; // WARN | ||
|
||
int tmp = *p; // NOWARN | ||
tmp = *(p - 1); // WARN | ||
p++; | ||
x++; | ||
} | ||
pthread_mutex_unlock(&mtx); | ||
|
||
pthread_join(thread, NULL); | ||
free(gptr); | ||
return 0; | ||
} |
43 changes: 43 additions & 0 deletions
43
tests/regression/85-relational-malloc/13-global-pointer2.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// PARAM: --set ana.activated[+] memOutOfBounds --set ana.activated[+] taintPartialContexts --set ana.activated[+] apron --set ana.apron.domain polyhedra --set ana.activated[+] allocVarEscaped --enable ana.int.interval | ||
#include <stdlib.h> | ||
#include <stdio.h> | ||
#include <pthread.h> | ||
|
||
int len; | ||
int *gptr; | ||
|
||
void *t_other() | ||
{ | ||
for (int i = 0; i < len; i++) | ||
{ | ||
gptr[i] = 42; // NOWARN | ||
// gptr[i + 1] = 42; // WARN | ||
// gptr[i - 1] = 42; // WARN | ||
|
||
// int tmp = gptr[i]; // NOWARN | ||
// int tmp = gptr[i + 1]; // WARN | ||
// int tmp = gptr[i - 1]; // WARN | ||
} | ||
} | ||
|
||
int main() | ||
{ | ||
len = rand(); | ||
len %= 10; | ||
gptr = malloc(sizeof(int) * len); | ||
|
||
t_other(); | ||
for (int i = 0; i < len; i++) | ||
{ | ||
gptr[i] = 42; // NOWARN | ||
// gptr[i + 1] = 42; // WARN | ||
// gptr[i - 1] = 42; // WARN | ||
|
||
// int tmp = gptr[i]; // NOWARN | ||
// int tmp = gptr[i + 1]; // WARN | ||
// int tmp = gptr[i - 1]; // WARN | ||
assert(i< len); | ||
} | ||
free(gptr); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters