mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 12:26:52 +08:00
This PR cleans up cast-overflow.cpp, more specifically: 1. avoid using undefined value as an exit code (old case `9`) 2. narrowing conversions are allowed to produce `inf` and they are well-defined. Remove dead code (old case `8`) 3. the same applies to the conversion int -> float16. Remove dead code (old case `7`) See also https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#:~:text=%2Dfsanitize%3Dfloat%2Dcast,to%20integer%20types. Currently ubsan doesn't properly detect UB on float16 -> int casts, I have a fix for that (will send as a separate PR).