Practical-Formal-Methods / adiff

Tool for differentially testing soundness and precision of program analyzers
MIT License
11 stars 6 forks source link

unsound: ultimate + cpachecker (undefined behavior) #114

Closed chkl closed 6 years ago

chkl commented 6 years ago
extern void __VERIFIER_error() __attribute__((__noreturn__));
void __VERIFIER_assert(int cond)
{
    if (!cond)
    {
    ERROR:
        __VERIFIER_error();
    }
}
void __DUMMY_VERIFIER_error()
{
}
void __DUMMY_VERIFIER_assert(int condition)
{
}
extern int __VERIFIER_nondet_int(void);
int main()
{
    int k = __VERIFIER_nondet_int();
    int a[1048];
    if (k >= 0 && k < 1048)
    {
        if (a[0] == 23 && a[k] == 42)
        {
            int x = __VERIFIER_nondet_int();
            while (x >= 0)
            {
                __VERIFIER_assert(k != 31241045 && k != -1365206408 && k != 0 && k != 0);
                x = x - k;
            }
        }
    }
    return 0;
}

http://pfm2.mpi-sws.org/program/368588388658cc363a8b8ea1824b63e2faf05218