extern void abort(void); void assume_abort_if_not(int cond) { if(!cond) {abort();} } extern _Bool __VERIFIER_nondet_bool(void); extern void abort(void); #include void reach_error() { assert(0); } void __VERIFIER_assert(int expression) { if (!expression) { ERROR: {reach_error();abort();} }; return; } extern void __VERIFIER_atomic_begin(); extern void __VERIFIER_atomic_end(); #include #include #ifndef TRUE #define TRUE (_Bool)1 #endif #ifndef FALSE #define FALSE (_Bool)0 #endif #ifndef NULL #define NULL ((void*)0) #endif #ifndef FENCE #define FENCE(x) ((void)0) #endif #ifndef IEEE_FLOAT_EQUAL #define IEEE_FLOAT_EQUAL(x,y) (x==y) #endif #ifndef IEEE_FLOAT_NOTEQUAL #define IEEE_FLOAT_NOTEQUAL(x,y) (x!=y) #endif void * P0(void *arg); void * P1(void *arg); void * P2(void *arg); void fence(); void isync(); void lwfence(); int __unbuffered_cnt; int __unbuffered_cnt = 0; int __unbuffered_p0_EAX; int __unbuffered_p0_EAX = 0; int __unbuffered_p1_EAX; int __unbuffered_p1_EAX = 0; int __unbuffered_p2_EAX; int __unbuffered_p2_EAX = 0; _Bool main$tmp_guard0; _Bool main$tmp_guard1; int x; int x = 0; int y; int y = 0; int z; int z = 0; void * P0(void *arg) { __VERIFIER_atomic_begin(); __unbuffered_p0_EAX = z; __VERIFIER_atomic_end(); __VERIFIER_atomic_begin(); x = 1; __VERIFIER_atomic_end(); __VERIFIER_atomic_begin(); __VERIFIER_atomic_end(); __VERIFIER_atomic_begin(); __unbuffered_cnt = __unbuffered_cnt + 1; __VERIFIER_atomic_end(); return 0; } void * P1(void *arg) { __VERIFIER_atomic_begin(); __unbuffered_p1_EAX = x; __VERIFIER_atomic_end(); __VERIFIER_atomic_begin(); y = 1; __VERIFIER_atomic_end(); __VERIFIER_atomic_begin(); __VERIFIER_atomic_end(); __VERIFIER_atomic_begin(); __unbuffered_cnt = __unbuffered_cnt + 1; __VERIFIER_atomic_end(); return 0; } void * P2(void *arg) { __VERIFIER_atomic_begin(); __unbuffered_p2_EAX = y; __VERIFIER_atomic_end(); __VERIFIER_atomic_begin(); z = 1; __VERIFIER_atomic_end(); __VERIFIER_atomic_begin(); __VERIFIER_atomic_end(); __VERIFIER_atomic_begin(); __unbuffered_cnt = __unbuffered_cnt + 1; __VERIFIER_atomic_end(); return 0; } void fence() { } void isync() { } void lwfence() { } int main() { pthread_t t1943; pthread_create(&t1943, NULL, P0, NULL); pthread_t t1944; pthread_create(&t1944, NULL, P1, NULL); pthread_t t1945; pthread_create(&t1945, NULL, P2, NULL); __VERIFIER_atomic_begin(); main$tmp_guard0 = __unbuffered_cnt == 3; __VERIFIER_atomic_end(); assume_abort_if_not(main$tmp_guard0); __VERIFIER_atomic_begin(); __VERIFIER_atomic_end(); __VERIFIER_atomic_begin(); /* Program was expected to be safe for X86, model checker should have said NO. This likely is a bug in the tool chain. */ main$tmp_guard1 = !(__unbuffered_p0_EAX == 1 && __unbuffered_p1_EAX == 1 && __unbuffered_p2_EAX == 1); __VERIFIER_atomic_end(); /* Program was expected to be safe for X86, model checker should have said NO. This likely is a bug in the tool chain. */ __VERIFIER_assert(main$tmp_guard1); return 0; }