stateful_check_false-unreach-call.c

loading
details
attribute value
description
owner Johannes Waldmann
uploaded 2017-08-17 03:45:15.0
disk size 2.52 KB
downloadable true
type
attribute value
name no_type
processor id 1
description this is the default benchmark type for rejected benchmarks and benchmarks that are not associated with a type.
owning community none
loading contents
extern void __VERIFIER_error() __attribute__ ((__noreturn__));

void __blast_assert(void) {
ERROR: __VERIFIER_error();
}



int ldv_mutex = 1;

int open_called = 0;
extern int __VERIFIER_nondet_int(void);

void mutex_lock(void)
{
  ((ldv_mutex == 1) ? 0 : __blast_assert());
  ldv_mutex = 2;
}

void mutex_unlock(void)
{
 ((ldv_mutex == 2) ? 0 : __blast_assert());
 ldv_mutex = 1;
}

void check_final_state(void)
{
 ((ldv_mutex == 1) ? 0 : __blast_assert());
}

static int misc_release() {


        if(open_called) {

                mutex_lock();
                mutex_unlock();
                open_called = 0;
        } else {

                mutex_lock();
                mutex_lock();
        }
        return 0;
}

static int misc_llseek() {
        return 0;
}

static int misc_read() {
        return 0;
}

static int misc_open()
{
        if(__VERIFIER_nondet_int()) {

                return 1;
        } else {
                open_called = 1;
                return 0;
        }
}

static int my_init(void)
{

        open_called = 0;
        return 0;
}

void main(void) {
        int ldv_s_misc_fops_file_operations = 0;
 my_init();
        while(__VERIFIER_nondet_int()) {

                switch(__VERIFIER_nondet_int()) {

                        case 0: {
                                if(ldv_s_misc_fops_file_operations==0) {
                                misc_open();
                                ldv_s_misc_fops_file_operations++;
                                }
                        }
   break;

                        case 1: {
                                if(ldv_s_misc_fops_file_operations==1) {
                                misc_read();
                                ldv_s_misc_fops_file_operations++;
                                }
                        }
                        break;

                        case 2: {
                                if(ldv_s_misc_fops_file_operations==2) {
                                misc_llseek();
                                ldv_s_misc_fops_file_operations++;
                                }
popout

content may be truncated. 'popout' for larger text window.

actions get anonymous link download benchmark