diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-03-27 23:20:25 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-03-27 23:20:25 +0000 |
commit | 508764518dd54eb7be82b0474cb42ef8dbe9ebd3 (patch) | |
tree | a719f1545893e39f38fce3c8f5853b749468d656 /test/CodeGen | |
parent | 87d2a37bde2890745a2d30d27985e354d91c2556 (diff) |
UBSan: Don't diagnose inf/nan conversions between floating-point types. It's far from clear whether these have undefined behavior, and these checks are helping no-one. Keep the double->float overflow warnings, though, since those are useful in practice, even though it's unclear whether such operations have defined behavior.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178194 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r-- | test/CodeGen/catch-undef-behavior.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/CodeGen/catch-undef-behavior.c b/test/CodeGen/catch-undef-behavior.c index 8e3388ea63..ebe39feea4 100644 --- a/test/CodeGen/catch-undef-behavior.c +++ b/test/CodeGen/catch-undef-behavior.c @@ -364,14 +364,17 @@ signed char fp16_char_overflow(__fp16 *p) { // CHECK: @float_float_overflow // CHECK-TRAP: @float_float_overflow float float_float_overflow(double f) { - // CHECK: %[[GE:.*]] = fcmp oge double %[[F:.*]], 0xC7EFFFFFE0000000 - // CHECK: %[[LE:.*]] = fcmp ole double %[[F]], 0x47EFFFFFE0000000 + // CHECK: %[[F:.*]] = call double @llvm.fabs.f64( + // CHECK: %[[GE:.*]] = fcmp ogt double %[[F]], 0x47EFFFFFE0000000 + // CHECK: %[[LE:.*]] = fcmp olt double %[[F]], 0x7FF0000000000000 // CHECK: and i1 %[[GE]], %[[LE]] // CHECK: call void @__ubsan_handle_float_cast_overflow( - // CHECK-TRAP: %[[GE:.*]] = fcmp oge double %[[F:.*]], 0xC7EFFFFFE0000000 - // CHECK-TRAP: %[[LE:.*]] = fcmp ole double %[[F]], 0x47EFFFFFE0000000 - // CHECK-TRAP: %[[INBOUNDS:.*]] = and i1 %[[GE]], %[[LE]] + // CHECK-TRAP: %[[F:.*]] = call double @llvm.fabs.f64( + // CHECK-TRAP: %[[GE:.*]] = fcmp ogt double %[[F]], 0x47EFFFFFE0000000 + // CHECK-TRAP: %[[LE:.*]] = fcmp olt double %[[F]], 0x7FF0000000000000 + // CHECK-TRAP: %[[OUTOFBOUNDS:.*]] = and i1 %[[GE]], %[[LE]] + // CHECK-TRAP: %[[INBOUNDS:.*]] = xor i1 %[[OUTOFBOUNDS]], true // CHECK-TRAP-NEXT: br i1 %[[INBOUNDS]] // CHECK-TRAP: call void @llvm.trap() [[NR_NUW]] |