-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94fa605
commit 18619f1
Showing
37 changed files
with
2,593 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
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
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
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
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
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
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
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
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
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
5 changes: 5 additions & 0 deletions
5
subprojects/xcfa/llvm2xcfa/src/test/resources/c/00assignment.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,5 @@ | ||
void reach_error(){} | ||
int main() { | ||
int a = 1; | ||
if(a) reach_error(); | ||
} |
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,6 @@ | ||
void reach_error(){} | ||
int __VERIFIER_nondet(); | ||
int main() { | ||
int a = __VERIFIER_nondet(); | ||
if(((char)a) != 0) reach_error(); | ||
} |
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,15 @@ | ||
void reach_error(){} | ||
int main() { | ||
_Bool a; | ||
unsigned char uc; | ||
signed char c; | ||
unsigned short us; | ||
short s; | ||
unsigned int ui; | ||
int i; | ||
unsigned long ul; | ||
long l; | ||
unsigned long long ull; | ||
long long ll; | ||
if(a+uc+c+us+s+ui+i+ul+l+ull+ll) reach_error(); | ||
} |
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,7 @@ | ||
void reach_error(){} | ||
int __VERIFIER_nondet_int(); | ||
int main() { | ||
int a = __VERIFIER_nondet_int(); | ||
a = a | 0; | ||
if(a == -10) reach_error(); | ||
} |
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,8 @@ | ||
void reach_error(){} | ||
extern float __VERIFIER_nondet_float(); | ||
int main() { | ||
float f = __VERIFIER_nondet_float(); | ||
double d = f; | ||
long double ld = d; | ||
if(ld > 0.28f && ld < 0.32f) reach_error(); | ||
} |
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,22 @@ | ||
void reach_error(){} | ||
float fabs(float); | ||
float floor(float); | ||
float round(float); | ||
float fmax(float, float); | ||
float fmin(float, float); | ||
float sqrt(float); | ||
int isnan(float); | ||
|
||
int main() { | ||
float f = 12.65f; | ||
float f1 = fabs(f); | ||
float f2 = floor(f); | ||
float f3 = round(f); | ||
float f4 = fmax(f2, f3); | ||
float f5 = fmin(f2, f3); | ||
float f6 = sqrt(f); | ||
float f7 = isnan(f); | ||
f = 0.0f; | ||
float f8 = isnan(0.0f/0.0f); | ||
if(f8) reach_error(); | ||
} |
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,8 @@ | ||
void reach_error(){} | ||
|
||
int main() { | ||
int a[2], b[3]; | ||
a[0] = 12; | ||
b[3] = a[0]; | ||
if(b[3] > 11) reach_error(); | ||
} |
7 changes: 7 additions & 0 deletions
7
subprojects/xcfa/llvm2xcfa/src/test/resources/c/07arrayinit.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,7 @@ | ||
void reach_error(){} | ||
|
||
int main() { | ||
int x; | ||
int a[3] = {2, x+1, 4}; | ||
if(a[1] > 2) reach_error(); | ||
} |
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,7 @@ | ||
void reach_error(){} | ||
|
||
int main() { | ||
int x; | ||
int a[3] = {1, 2, 3}; | ||
if(a[x] == 2) reach_error(); | ||
} |
16 changes: 16 additions & 0 deletions
16
subprojects/xcfa/llvm2xcfa/src/test/resources/c/09struct.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,16 @@ | ||
void reach_error(){} | ||
|
||
struct A{ | ||
int a; | ||
char c; | ||
struct { | ||
int a; | ||
} b; | ||
}; | ||
|
||
int main() { | ||
struct A a; | ||
a.a = 3; | ||
a.c = 1; | ||
if(a.a + a.c + a.b.a < 4) reach_error(); | ||
} |
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,13 @@ | ||
void reach_error(){} | ||
|
||
int main() { | ||
int a = 110; | ||
int *b = &a; | ||
char *c = (char*)b; | ||
a = 90; | ||
char d = *c; | ||
if(d > 100) reach_error(); | ||
*b = 120; | ||
d = *c; | ||
if(d > 100) reach_error(); | ||
} |
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,12 @@ | ||
void reach_error(){} | ||
|
||
void check_geq_110(int* param) { | ||
if(*param >= 110) reach_error(); | ||
} | ||
|
||
int main() { | ||
int a = 100, b = 110, c = 120; | ||
check_geq_110(&a); | ||
check_geq_110(&b); | ||
check_geq_110(&c); | ||
} |
11 changes: 11 additions & 0 deletions
11
subprojects/xcfa/llvm2xcfa/src/test/resources/c/12ptrtypes.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,11 @@ | ||
void reach_error(){} | ||
|
||
void check_geq_110(void* param) { | ||
if(*(unsigned int*)param <= 110) reach_error(); | ||
} | ||
|
||
int main() { | ||
float f = 0.3f; | ||
unsigned int all = -1; | ||
check_geq_110(&all); | ||
} |
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,8 @@ | ||
void reach_error(){} | ||
|
||
|
||
char char1; | ||
int main() { | ||
char char2; | ||
if(char1 + char2 > 256) reach_error(); | ||
} |
10 changes: 10 additions & 0 deletions
10
subprojects/xcfa/llvm2xcfa/src/test/resources/c/14ushort.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,10 @@ | ||
void reach_error(){} | ||
|
||
extern unsigned short __VERIFIER_nondet_ushort(); | ||
|
||
int main() { | ||
short ush; | ||
long c; | ||
ush = __VERIFIER_nondet_ushort(); | ||
if(ush) reach_error(); | ||
} |
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,7 @@ | ||
void reach_error(){} | ||
|
||
int main() { | ||
int z = 6; | ||
int y = 1; | ||
if((z*z) - 12 * y - 6 * z + 12 == 0) reach_error(); | ||
} |
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,7 @@ | ||
void reach_error(){} | ||
|
||
int main() { | ||
for(int i = 0; i < 30; i++) { | ||
if(i == 28) reach_error(); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
subprojects/xcfa/llvm2xcfa/src/test/resources/c/17recursive.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,11 @@ | ||
void reach_error(){} | ||
|
||
int fibonacci(int i) { | ||
if(i == 0) return 0; | ||
else if(i == 1) return 1; | ||
else return fibonacci(i-1) + fibonacci(i-2); | ||
} | ||
|
||
int main() { | ||
if(fibonacci(8) != 21) reach_error(); | ||
} |
Oops, something went wrong.