diff options
| author | Dan Liew <delcypher@gmail.com> | 2014-02-14 18:49:42 +0000 |
|---|---|---|
| committer | Dan Liew <delcypher@gmail.com> | 2014-02-14 18:49:42 +0000 |
| commit | 66c064d482160e6c31ccf8ecb0aa93a7529d3da1 (patch) | |
| tree | 1ed4ba4cc639b178f16d8a56bd75799d5033904e /test/Solver/overshift-left-by-symbolic.kquery | |
| parent | d2f1684355e9a99545aa864e3eac81b259712a6f (diff) | |
| parent | 6e4e74b99a199ead458b0b919286d667bd8e8f28 (diff) | |
| download | klee-66c064d482160e6c31ccf8ecb0aa93a7529d3da1.tar.gz | |
Merge pull request #64 from delcypher/overshift-fix
Overshift fixes
Diffstat (limited to 'test/Solver/overshift-left-by-symbolic.kquery')
| -rw-r--r-- | test/Solver/overshift-left-by-symbolic.kquery | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/Solver/overshift-left-by-symbolic.kquery b/test/Solver/overshift-left-by-symbolic.kquery new file mode 100644 index 00000000..9d0d272c --- /dev/null +++ b/test/Solver/overshift-left-by-symbolic.kquery @@ -0,0 +1,26 @@ +# RUN: %kleaver %s > %t +# RUN: not grep INVALID %t + +array shift[4] : w32 -> w8 = symbolic +# ∀ x. x >= 32 → ( (2 << x) = 0 ) +# Check we left overshift to zero when shifting a constant ALWAYS! + +(query [ (Ule (w32 32) (ReadLSB w32 (w32 0) shift)) ] + (Eq + (Shl w32 (w32 2) + (ReadLSB w32 (w32 0) shift) + ) + (w32 0) + ) [ ] [shift] ) + +# 64-bit version +# ∀ x. x >= 64 → ( (2 << x) = 0 ) +array shift64[8] : w32 -> w8 = symbolic + +(query [ (Ule (w64 64) (ReadLSB w64 (w32 0) shift64)) ] + (Eq + (Shl w64 (w64 2) + (ReadLSB w64 (w32 0) shift64) + ) + (w64 0) + ) [ ] [shift64] ) |
