about summary refs log tree commit diff homepage
path: root/test/Feature/ubsan/ubsan_float_divide_by_zero.c
blob: eec443938bd0ea7bc5dcaa0ead82b6702bb67746 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// RUN: %clang %s -fsanitize=float-divide-by-zero -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 x = 1.0;

  //  klee_make_symbolic(&x, sizeof(x), "x");
  //  klee_assume(x != 0.0);

  // CHECK: runtime/Sanitizer/ubsan/ubsan_handlers.cpp:35: float-divide-by-zero
  volatile float result = x / 0;
}