From de7d94e27bc92292c74fd045b2565581694314a7 Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Fri, 20 Jul 2012 15:29:12 +0000 Subject: Fixed bug FPToSI bug reported by Peng Li. Added a simple test case. git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@160547 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Feature/FloatingPt.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/Feature/FloatingPt.c (limited to 'test') 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 + +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; +} -- cgit 1.4.1