diff options
Diffstat (limited to 'test/Feature/OvershiftCheck.c')
-rw-r--r-- | test/Feature/OvershiftCheck.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/Feature/OvershiftCheck.c b/test/Feature/OvershiftCheck.c index 09cbf8ba..ace54cee 100644 --- a/test/Feature/OvershiftCheck.c +++ b/test/Feature/OvershiftCheck.c @@ -1,26 +1,26 @@ // RUN: %llvmgcc %s -emit-llvm -g -O0 -c -o %t.bc // RUN: rm -rf %t.klee-out // RUN: %klee --output-dir=%t.klee-out -check-overshift %t.bc 2> %t.log -// RUN: grep -c "overshift error" %t.log -// RUN: grep -c "OvershiftCheck.c:20: overshift error" %t.log -// RUN: grep -c "OvershiftCheck.c:24: overshift error" %t.log +// RUN: FileCheck --input-file %t.log %s /* This test checks that two consecutive potential overshifts * are reported as errors. */ -int main() -{ - unsigned int x=15; +#include "klee/klee.h" +int main() { + unsigned int x = 15; unsigned int y; unsigned int z; volatile unsigned int result; /* Overshift if y>= sizeof(x) */ - klee_make_symbolic(&y,sizeof(y),"shift_amount1"); + klee_make_symbolic(&y, sizeof(y), "shift_amount1"); + // CHECK: OvershiftCheck.c:[[@LINE+1]]: overshift error result = x << y; /* Overshift is z>= sizeof(x) */ - klee_make_symbolic(&z,sizeof(z),"shift_amount2"); + klee_make_symbolic(&z, sizeof(z), "shift_amount2"); + // CHECK: OvershiftCheck.c:[[@LINE+1]]: overshift error result = x >> z; return 0; |