about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorWillem <willem@lekkertech.net>2014-10-09 07:50:26 -0700
committerWillem <willem@lekkertech.net>2014-10-15 12:31:57 -0700
commitf0e50a8374a398e52b224dff2aa88384f90424ff (patch)
tree733606c0032f60d62b758915c12010582c88a1c6
parent12e0bdc6595dea6133084b6014845e5436930457 (diff)
downloadklee-f0e50a8374a398e52b224dff2aa88384f90424ff.tar.gz
Fixed test/Concrete/ConstantExpr.ll
The difference between a 64bit pointer truncated to 32 bits and the
original 64bit pointer would never be 0 if any of the high 32bits in
the pointer were test. If lli and klee had a different value for the
top 32bits of the address this test would be marked as failing.

Due to the 64bit printing buf in _testingUtils this was not exposed before.

The fix clears the top 32bits of the difference.
-rw-r--r--test/Concrete/ConstantExpr.ll4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/Concrete/ConstantExpr.ll b/test/Concrete/ConstantExpr.ll
index 3a151a0f..351223e7 100644
--- a/test/Concrete/ConstantExpr.ll
+++ b/test/Concrete/ConstantExpr.ll
@@ -24,8 +24,8 @@ define void @"test_int_to_ptr"() {
 
 define void @"test_constant_ops"() {
   %t1 = add i8 trunc(i64 add(i64 ptrtoint(i32* @gInt to i64), i64 -10) to i8), 10
-  %t2 = sub i64 sext(i32 ptrtoint(i32* @gInt to i32) to i64), ptrtoint(i32* @gInt to i64)
-  %t3 = sub i64 zext(i32 ptrtoint(i32* @gInt to i32) to i64), ptrtoint(i32* @gInt to i64)
+  %t2 = and i64 sub(i64 sext(i32 ptrtoint(i32* @gInt to i32) to i64), i64 ptrtoint(i32* @gInt to i64)), 4294967295
+  %t3 = and i64 sub(i64 zext(i32 ptrtoint(i32* @gInt to i32) to i64), i64 ptrtoint(i32* @gInt to i64)), 4294967295
 
   %t4 = icmp eq i8 trunc(i64 ptrtoint(i32* @gInt to i64) to i8), %t1
   %t5 = zext i1 %t4 to i8