From 4ccb533158d40e15db9e9f2ade9bb28c3f83f38e Mon Sep 17 00:00:00 2001 From: Pavel Yatcheniy Date: Thu, 28 Jan 2021 17:51:04 +0300 Subject: Support UBSan-enabled binaries --- test/Feature/ubsan/ubsan_float_cast_overflow.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/Feature/ubsan/ubsan_float_cast_overflow.c (limited to 'test/Feature/ubsan/ubsan_float_cast_overflow.c') diff --git a/test/Feature/ubsan/ubsan_float_cast_overflow.c b/test/Feature/ubsan/ubsan_float_cast_overflow.c new file mode 100644 index 00000000..749a340e --- /dev/null +++ b/test/Feature/ubsan/ubsan_float_cast_overflow.c @@ -0,0 +1,16 @@ +// RUN: %clang %s -fsanitize=float-cast-overflow -emit-llvm -g %O0opt -c -o %t.bc +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --emit-all-errors --ubsan-runtime %t.bc 2>&1 | FileCheck %s + +#include "klee/klee.h" + +int main() { + float f = 0x7fffff80; + volatile int result; + + // klee_make_symbolic(&f, sizeof(f), "f"); + + // CHECK: runtime/Sanitizer/ubsan/ubsan_handlers.cpp:35: float-cast-overflow + result = f + 0x80; + return 0; +} -- cgit 1.4.1