From 7ea8afa20439c579c4a1ccb251a78770ef873787 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sat, 27 Jun 2009 00:55:57 +0000 Subject: Start move to using APFloat (support long double). - Incomplete, still have to move some conversion operations. - Also, there isn't support yet for copying long double values to native memory. - Still, should be a monotonic improvement and we are no longer faking long double support. git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@74363 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Feature/LongDoubleSupport.c | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/Feature/LongDoubleSupport.c b/test/Feature/LongDoubleSupport.c index b4631832..185a5485 100644 --- a/test/Feature/LongDoubleSupport.c +++ b/test/Feature/LongDoubleSupport.c @@ -1,8 +1,9 @@ // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t1.bc -// RUN: %klee --exit-on-error %t1.bc > %t2.out +// RUN: %klee --optimize=0 --exit-on-error %t1.bc > %t2.out #include #include +#include // FIXME: This doesn't really work at all, it just doesn't // crash. Until we have wide constant support, that is all we care @@ -10,11 +11,29 @@ // constants, we don't actually end up seeing much code which uses long // double. int main() { - long double a = LDBL_MAX; - long double b = -1; - long double c = a + b; - printf("a = %Lg\n", a); - printf("b = %Lg\n", b); - printf("c = %Lg\n", c); + unsigned N0 = 0, N1 = 0, N2 = 0; + + float V0 = .1; + while (V0 != 0) { + V0 *= V0; + N0++; + } + double V1 = .1; + while (V1 != 0) { + V1 *= V1; + N1++; + } + long double V2 = .1; + while (V2 != 0) { + V2 *= V2; + N2++; + } + + printf("counts: %d, %d, %d\n", N0, N1, N2); + + assert(N0 == 6); + assert(N1 == 9); + assert(N2 == 13); + return 0; } -- cgit 1.4.1