Skip to content

Commit

Permalink
Enable svcomp library functions where racemacros.h is included
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-schwarz committed Oct 1, 2023
1 parent 9fb68d4 commit c8ed7e2
Show file tree
Hide file tree
Showing 52 changed files with 72 additions and 46 deletions.
3 changes: 2 additions & 1 deletion tests/regression/28-race_reach/01-simple_racing.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand All @@ -19,4 +20,4 @@ int main(void) {
pthread_mutex_unlock(&mutex2);
join_threads(t);
return 0;
}
}
3 changes: 2 additions & 1 deletion tests/regression/28-race_reach/02-simple_racefree.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand All @@ -19,4 +20,4 @@ int main(void) {
pthread_mutex_unlock(&mutex1);
join_threads(t);
return 0;
}
}
3 changes: 2 additions & 1 deletion tests/regression/28-race_reach/03-munge_racing.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand Down Expand Up @@ -26,4 +27,4 @@ int main(void) {
create_threads(t1); create_threads(t2);
join_threads(t1); join_threads(t2);
return 0;
}
}
3 changes: 2 additions & 1 deletion tests/regression/28-race_reach/04-munge_racefree.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand Down Expand Up @@ -26,4 +27,4 @@ int main(void) {
create_threads(t1); create_threads(t2);
join_threads(t1); join_threads(t2);
return 0;
}
}
3 changes: 2 additions & 1 deletion tests/regression/28-race_reach/05-lockfuns_racefree.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand Down Expand Up @@ -26,4 +27,4 @@ int main(void) {
unlock();
join_threads(t);
return 0;
}
}
5 changes: 1 addition & 4 deletions tests/regression/28-race_reach/06-cond_racing1.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//PARAM: --set lib.activated[+] sv-comp
#include<stdio.h>
#include<pthread.h>

Expand Down Expand Up @@ -31,7 +32,3 @@ int main() {
join_threads(t);
return 0;
}




1 change: 1 addition & 0 deletions tests/regression/28-race_reach/07-cond_racing2.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//PARAM: --set lib.activated[+] sv-comp
#include<stdio.h>
#include<pthread.h>
#include "racemacros.h"
Expand Down
1 change: 1 addition & 0 deletions tests/regression/28-race_reach/08-cond_racefree.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//PARAM: --set lib.activated[+] sv-comp
#include<stdio.h>
#include<pthread.h>
#include "racemacros.h"
Expand Down
3 changes: 2 additions & 1 deletion tests/regression/28-race_reach/09-ptrmunge_racing.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand Down Expand Up @@ -27,4 +28,4 @@ int main(void) {
create_threads(t1); create_threads(t2);
join_threads(t1); join_threads(t2);
return 0;
}
}
3 changes: 2 additions & 1 deletion tests/regression/28-race_reach/10-ptrmunge_racefree.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand Down Expand Up @@ -27,4 +28,4 @@ int main(void) {
create_threads(t1); create_threads(t2);
join_threads(t1); join_threads(t2);
return 0;
}
}
3 changes: 2 additions & 1 deletion tests/regression/28-race_reach/11-ptr_racing.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand All @@ -20,4 +21,4 @@ int main(void) {
pthread_mutex_unlock(&mutex2);
join_threads(t);
return 0;
}
}
5 changes: 3 additions & 2 deletions tests/regression/28-race_reach/12-ptr_racefree.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand All @@ -16,8 +17,8 @@ void *t_fun(void *arg) {
int main(void) {
create_threads(t);
pthread_mutex_lock(&mutex1);
assert_racefree(global);
assert_racefree(global);
pthread_mutex_unlock(&mutex1);
join_threads(t);
return 0;
}
}
1 change: 1 addition & 0 deletions tests/regression/28-race_reach/19-callback_racing.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// PARAM: --set lib.activated[+] sv-comp
extern int __VERIFIER_nondet_int();

#include<pthread.h>
Expand Down
1 change: 1 addition & 0 deletions tests/regression/28-race_reach/20-callback_racefree.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// PARAM: --set lib.activated[+] sv-comp
extern int __VERIFIER_nondet_int();

#include<pthread.h>
Expand Down
1 change: 1 addition & 0 deletions tests/regression/28-race_reach/21-deref_read_racing.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand Down
1 change: 1 addition & 0 deletions tests/regression/28-race_reach/22-deref_read_racefree.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand Down
1 change: 1 addition & 0 deletions tests/regression/28-race_reach/23-sound_unlock_racing.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand Down
1 change: 1 addition & 0 deletions tests/regression/28-race_reach/24-sound_lock_racing.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand Down
7 changes: 4 additions & 3 deletions tests/regression/28-race_reach/27-funptr_racing.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
// PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include <stdio.h>
#include "racemacros.h"

int global;
pthread_mutex_t gm = PTHREAD_MUTEX_INITIALIZER;

void bad() {
void bad() {
access(global);
}

void good() {
void good() {
pthread_mutex_lock(&gm);
access(global);
pthread_mutex_unlock(&gm);
Expand Down Expand Up @@ -42,4 +43,4 @@ int main() {

join_threads(t);
return 0;
}
}
9 changes: 5 additions & 4 deletions tests/regression/28-race_reach/28-funptr_racefree.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include <stdio.h>
#include "racemacros.h"

int global = 0;
pthread_mutex_t gm = PTHREAD_MUTEX_INITIALIZER;

void bad() {
void bad() {
access(global);
}
void good() {
}
void good() {
pthread_mutex_lock(&gm);
access(global);
pthread_mutex_unlock(&gm);
Expand Down Expand Up @@ -41,4 +42,4 @@ int main() {

join_threads(t);
return 0;
}
}
1 change: 1 addition & 0 deletions tests/regression/28-race_reach/36-indirect_racefree.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand Down
1 change: 1 addition & 0 deletions tests/regression/28-race_reach/37-indirect_racing.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand Down
3 changes: 2 additions & 1 deletion tests/regression/28-race_reach/40-trylock_racing.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand Down Expand Up @@ -25,4 +26,4 @@ int main(void) {
pthread_mutex_unlock(&mutex); // no UB because ERRORCHECK
join_threads(t);
return 0;
}
}
3 changes: 2 additions & 1 deletion tests/regression/28-race_reach/41-trylock_racefree.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand All @@ -22,4 +23,4 @@ int main(void) {
pthread_mutex_unlock(&mutex);
join_threads(t);
return 0;
}
}
3 changes: 2 additions & 1 deletion tests/regression/28-race_reach/42-trylock2_racefree.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand Down Expand Up @@ -35,4 +36,4 @@ int main(void) {

join_threads(t);
return 0;
}
}
1 change: 1 addition & 0 deletions tests/regression/28-race_reach/45-escape_racing.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand Down
1 change: 1 addition & 0 deletions tests/regression/28-race_reach/46-escape_racefree.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand Down
1 change: 1 addition & 0 deletions tests/regression/28-race_reach/51-mutexptr_racefree.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// PARAM: --set lib.activated[+] sv-comp
#include <pthread.h>
#include "racemacros.h"

Expand Down
1 change: 1 addition & 0 deletions tests/regression/28-race_reach/60-invariant_racefree.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// PARAM: --set lib.activated[+] sv-comp
#include<pthread.h>
#include "racemacros.h"

Expand Down
1 change: 1 addition & 0 deletions tests/regression/28-race_reach/61-invariant_racing.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// PARAM: --set lib.activated[+] sv-comp
#include<pthread.h>
#include "racemacros.h"

Expand Down
2 changes: 1 addition & 1 deletion tests/regression/28-race_reach/70-funloop_racefree.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PARAM: --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'"
// PARAM: --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --set lib.activated[+] sv-comp
#include<pthread.h>
#include<stdio.h>
#include "racemacros.h"
Expand Down
2 changes: 1 addition & 1 deletion tests/regression/28-race_reach/71-funloop_racing.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PARAM: --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'"
// PARAM: --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --set lib.activated[+] sv-comp
#include<pthread.h>
#include<stdio.h>
#include "racemacros.h"
Expand Down
2 changes: 1 addition & 1 deletion tests/regression/28-race_reach/72-funloop_hard_racing.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PARAM: --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'"
// PARAM: --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --set lib.activated[+] sv-comp
#include<pthread.h>
#include<stdio.h>
#include "racemacros.h"
Expand Down
2 changes: 1 addition & 1 deletion tests/regression/28-race_reach/73-funloop_hard_racefree.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PARAM: --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'"
// PARAM: --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --set lib.activated[+] sv-comp
#include<pthread.h>
#include<stdio.h>
#include "racemacros.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PARAM: --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'"
// PARAM: --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --set lib.activated[+] sv-comp
#include<pthread.h>
#include<stdio.h>
#include "racemacros.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PARAM: --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'"
// PARAM: --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --set lib.activated[+] sv-comp
#include<pthread.h>
#include<stdio.h>
#include "racemacros.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PARAM: --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'"
// PARAM: --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --set lib.activated[+] sv-comp
#include<pthread.h>
#include<stdio.h>
#include "racemacros.h"
Expand Down
2 changes: 1 addition & 1 deletion tests/regression/28-race_reach/77-tricky_address4_racing.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PARAM: --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'"
// PARAM: --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --set lib.activated[+] sv-comp
#include<pthread.h>
#include<stdio.h>
#include "racemacros.h"
Expand Down
2 changes: 1 addition & 1 deletion tests/regression/28-race_reach/78-equ_racing.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PARAM: --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'"
// PARAM: --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --set lib.activated[+] sv-comp
#include<pthread.h>
#include<stdlib.h>
#include "racemacros.h"
Expand Down
2 changes: 1 addition & 1 deletion tests/regression/28-race_reach/79-equ_racefree.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PARAM: --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'"
// PARAM: --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --set lib.activated[+] sv-comp
#include<pthread.h>
#include<stdlib.h>
#include "racemacros.h"
Expand Down
2 changes: 1 addition & 1 deletion tests/regression/28-race_reach/81-list_racing.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PARAM: --set ana.activated[+] "'region'"
// PARAM: --set ana.activated[+] "'region'" --set lib.activated[+] sv-comp
#include<stdlib.h>
#include "racemacros.h"

Expand Down
2 changes: 1 addition & 1 deletion tests/regression/28-race_reach/82-list_racefree.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PARAM: --set ana.activated[+] "'region'"
// PARAM: --set ana.activated[+] "'region'" --set lib.activated[+] sv-comp
#include<stdlib.h>
#include "racemacros.h"

Expand Down
2 changes: 1 addition & 1 deletion tests/regression/28-race_reach/83-list2_racing1.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PARAM: --set ana.activated[+] "'region'"
// PARAM: --set ana.activated[+] "'region'" --set lib.activated[+] sv-comp
#include<stdlib.h>
#include "racemacros.h"

Expand Down
2 changes: 1 addition & 1 deletion tests/regression/28-race_reach/84-list2_racing2.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PARAM: --set ana.activated[+] "'region'"
// PARAM: --set ana.activated[+] "'region'" --set lib.activated[+] sv-comp
#include<stdlib.h>
#include "racemacros.h"

Expand Down
2 changes: 1 addition & 1 deletion tests/regression/28-race_reach/85-list2_racefree.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PARAM: --set ana.activated[+] "'region'"
// PARAM: --set ana.activated[+] "'region'" --set lib.activated[+] sv-comp
#include<stdlib.h>
#include "racemacros.h"

Expand Down
2 changes: 1 addition & 1 deletion tests/regression/28-race_reach/86-lists_racing.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PARAM: --set ana.activated[+] "'region'"
// PARAM: --set ana.activated[+] "'region'" --set lib.activated[+] sv-comp
#include<stdlib.h>
#include "racemacros.h"

Expand Down
2 changes: 1 addition & 1 deletion tests/regression/28-race_reach/87-lists_racefree.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PARAM: --set ana.activated[+] "'region'"
// PARAM: --set ana.activated[+] "'region'" --set lib.activated[+] sv-comp
#include<stdlib.h>
#include "racemacros.h"

Expand Down
2 changes: 1 addition & 1 deletion tests/regression/28-race_reach/90-arrayloop2_racing.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PARAM: --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --set ana.activated[+] "'region'" --set exp.region-offsets true
// PARAM: --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --set ana.activated[+] "'region'" --set exp.region-offsets true --set lib.activated[+] sv-comp
#include<pthread.h>
#include<stdlib.h>
#include "racemacros.h"
Expand Down
Loading

0 comments on commit c8ed7e2

Please sign in to comment.