diff options
Diffstat (limited to 'test/CodeGen/ubsan-conditional.c')
| -rw-r--r-- | test/CodeGen/ubsan-conditional.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CodeGen/ubsan-conditional.c b/test/CodeGen/ubsan-conditional.c new file mode 100644 index 0000000000000..7f63b39a23075 --- /dev/null +++ b/test/CodeGen/ubsan-conditional.c @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 %s -emit-llvm -fsanitize=float-divide-by-zero -o - | FileCheck %s + +_Bool b; +// CHECK: @f( +double f() { + // CHECK: %[[B:.*]] = load {{.*}} @b + // CHECK: %[[COND:.*]] = trunc {{.*}} %[[B]] to i1 + // CHECK: br i1 %[[COND]] + return b ? 0.0 / 0.0 : 0.0; +} |
