https://bugs.llvm.org/show_bug.cgi?id=46811
Bug ID: 46811
Summary: ARM isnormal(long double NaN) raises invalid
Product: clang
Version: 10.0
Hardware: Other
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected],
[email protected]
/*
* isnormal(long double NaN) raises invalid; it should not.
*/
#include <float.h>
#include <math.h>
#include <fenv.h>
#include <stdio.h>
int main(void){
long double ldnan = NAN;
long double ldinf = INFINITY;
int ex;
feclearexcept( FE_ALL_EXCEPT );
if( isnormal(ldnan) ){
(void)printf("bug 1: NAN is not normal\n");
}
ex = fetestexcept( FE_ALL_EXCEPT );
if( 0 != ex ){
(void)printf("bug 2: ex=%#x, FE_INVALID=%#x, ldnan=%Lg\n", ex, FE_INVALID,
ldnan);
}
feclearexcept( FE_ALL_EXCEPT );
if( isnormal(ldinf) ){
(void)printf("bug 3: INFINITY is not normal\n");
}
ex = fetestexcept( FE_ALL_EXCEPT );
if( 0 != ex ){
(void)printf("bug 4: ex=%#x, FE_INVALID=%#x, ldinf=%Lg\n", ex, FE_INVALID,
ldinf);
}
return 0;
}
I am not sure if this is a compiler built-in or part of the math library.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs