about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-rw-r--r--test/Feature/arithmetic-right-overshift-sym-conc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/Feature/arithmetic-right-overshift-sym-conc.c b/test/Feature/arithmetic-right-overshift-sym-conc.c
index 7af6f9d7..6a9bbc21 100644
--- a/test/Feature/arithmetic-right-overshift-sym-conc.c
+++ b/test/Feature/arithmetic-right-overshift-sym-conc.c
@@ -13,6 +13,8 @@ typedef enum
     UNKNOWN
 } overshift_t;
 
+#define INT_31_BITS	(0xffffffff >> 1)
+
 // We're using signed ints so should be doing
 // arithmetic right shift.
 // lhs should be a constant
@@ -20,7 +22,7 @@ int overshift(signed int lhs, volatile unsigned int y, const char * type)
 {
     overshift_t ret;
     volatile signed int x = lhs;
-    unsigned int limit = sizeof(x)*8;
+    unsigned int limit = sizeof(x)*8 - 1;
     assert(!klee_is_symbolic(x));
 
     volatile signed int result;
@@ -47,12 +49,12 @@ int overshift(signed int lhs, volatile unsigned int y, const char * type)
 
 int main(int argc, char** argv)
 {
-    volatile unsigned int y = sizeof(unsigned int)*8;
+    volatile unsigned int y = sizeof(unsigned int)*8 - 1;
     // Try with +ve lhs
     overshift_t conc = overshift(15, y, "Concrete");
     assert(conc == TO_ZERO);
     // Try with -ve lhs
-    conc = overshift(-1, y, "Concrete");
+    conc = overshift(INT_31_BITS, y, "Concrete");
     assert(conc == TO_ZERO);
 
     // Symbolic overshift
@@ -65,7 +67,7 @@ int main(int argc, char** argv)
     overshift_t sym = overshift(15, y2, "Symbolic");
     assert(sym == TO_ZERO);
     // Try with -ve lhs
-    sym = overshift(-1, y2, "Symbolic");
+    sym = overshift(INT_31_BITS, y2, "Symbolic");
     assert(sym == TO_ZERO);
 
     // Concrete and symbolic behaviour should be the same