about summary refs log tree commit diff homepage
path: root/test/Feature
diff options
context:
space:
mode:
Diffstat (limited to 'test/Feature')
-rw-r--r--test/Feature/FloatingPt.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Feature/FloatingPt.c b/test/Feature/FloatingPt.c
new file mode 100644
index 00000000..bde9e19b
--- /dev/null
+++ b/test/Feature/FloatingPt.c
@@ -0,0 +1,23 @@
+// RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t1.bc
+// RUN: %klee --exit-on-error %t1.bc
+
+#include <assert.h>
+
+int main() {
+  double a1 = -1.1;
+  double a2 = 1.2;
+  
+  int b1 = (int) a1;
+  assert(b1 == -1);
+  
+  int b2 = (int) a2;
+  assert(b2 == 1);
+
+  a1 = (double) b1;
+  assert(a1 == -1);
+
+  a2 = (double) b2;
+  assert(a2 == 1);
+
+  return 0;
+}