llvm-project/clang/test/CodeGen/const-unordered-compare.c
Mon P Wang 75c645c6d7 A not equal for an unordered relation should return true as specified in IEEE-754, e.g.,
NAN != NAN ? 1 : 0 should return 1.  Also fix the case for complex.

llvm-svn: 102598
2010-04-29 05:53:29 +00:00

8 lines
207 B
C

// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
// Checks folding of an unordered comparison
int nan_ne_check() {
// CHECK: store i32 1
return (__builtin_nanf("") != __builtin_nanf("")) ? 1 : 0;
}