about summary refs log tree commit diff homepage
path: root/test
diff options
context:
space:
mode:
authorDavid Laprell <david.laprell@rwth-aachen.de>2020-01-14 12:29:06 +0100
committerCristian Cadar <c.cadar@imperial.ac.uk>2020-10-09 21:46:06 +0100
commit6e0209e74ef814aa27af2add01d22284817c3d73 (patch)
tree1f6b4601108546e850f1771b25f02ffe4e5939f1 /test
parent356b0471a11370b4c8833519a2d9ffbe8ce6b2e1 (diff)
downloadklee-6e0209e74ef814aa27af2add01d22284817c3d73.tar.gz
fix: fabs() working on the wrong argument
Diffstat (limited to 'test')
-rw-r--r--test/regression/2020-01-14-fabs-compare.c16
1 files changed, 16 insertions, 0 deletions
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 <math.h>
+#include <assert.h>
+
+int main(void) {
+  long double a = 0.25;
+  long double b = -a;
+
+  long double b_abs = fabsl(b);
+
+  assert(a == b_abs);
+  return 0;
+}