We have the right check to know that errno is not set:
...ahead of the switch.
But after reviewing the C standard text, I'm not sure the previous behavior was correct in the first place. If "implementation-defined" is actually defined by the platform, then a compiler can't assume that value (is nan) as we were doing?
This will solve https://bugs.llvm.org/show_bug.cgi?id=27435 although I'm still planning to make clang changes for intrinsics after D39611. That would create the sqrt intrinsic before we ever reach this place in LLVM.