From 6e0209e74ef814aa27af2add01d22284817c3d73 Mon Sep 17 00:00:00 2001 From: David Laprell Date: Tue, 14 Jan 2020 12:29:06 +0100 Subject: fix: fabs() working on the wrong argument --- test/regression/2020-01-14-fabs-compare.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/regression/2020-01-14-fabs-compare.c (limited to 'test') diff --git a/test/regression/2020-01-14-fabs-compare.c b/test/regression/2020-01-14-fabs-compare.c new file mode 100644 index 00000000..563a6609 --- /dev/null +++ b/test/regression/2020-01-14-fabs-compare.c @@ -0,0 +1,16 @@ +// RUN: %clang %s -emit-llvm %O0opt -g -c -o %t.bc +// RUN: rm -rf %t.klee-out +// RUN: %klee --exit-on-error --output-dir=%t.klee-out %t.bc + +#include +#include + +int main(void) { + long double a = 0.25; + long double b = -a; + + long double b_abs = fabsl(b); + + assert(a == b_abs); + return 0; +} -- cgit 1.4.1