New tests.
From-SVN: r56924
This commit is contained in:
parent
5c102b484a
commit
ff6c6aa895
2 changed files with 48 additions and 0 deletions
35
gcc/testsuite/gcc.c-torture/execute/ieee/inf-1.c
Normal file
35
gcc/testsuite/gcc.c-torture/execute/ieee/inf-1.c
Normal file
|
@ -0,0 +1,35 @@
|
|||
extern void abort (void);
|
||||
|
||||
int main()
|
||||
{
|
||||
float fi = __builtin_inff();
|
||||
double di = __builtin_inf();
|
||||
long double li = __builtin_infl();
|
||||
|
||||
float fh = __builtin_huge_valf();
|
||||
double dh = __builtin_huge_val();
|
||||
long double lh = __builtin_huge_vall();
|
||||
|
||||
if (fi + fi != fi)
|
||||
abort ();
|
||||
if (di + di != di)
|
||||
abort ();
|
||||
if (li + li != li)
|
||||
abort ();
|
||||
|
||||
if (fi != fh)
|
||||
abort ();
|
||||
if (di != dh)
|
||||
abort ();
|
||||
if (li != lh)
|
||||
abort ();
|
||||
|
||||
if (fi <= 0)
|
||||
abort ();
|
||||
if (di <= 0)
|
||||
abort ();
|
||||
if (li <= 0)
|
||||
abort ();
|
||||
|
||||
return 0;
|
||||
}
|
13
gcc/testsuite/gcc.dg/builtin-inf-1.c
Normal file
13
gcc/testsuite/gcc.dg/builtin-inf-1.c
Normal file
|
@ -0,0 +1,13 @@
|
|||
/* { dg-do compile } */
|
||||
|
||||
float fi = __builtin_inff();
|
||||
double di = __builtin_inf();
|
||||
long double li = __builtin_infl();
|
||||
|
||||
float fh = __builtin_huge_valf();
|
||||
double dh = __builtin_huge_val();
|
||||
long double lh = __builtin_huge_vall();
|
||||
|
||||
/* { dg-warning "does not support infinity" "INF unsupported" { target vax-*-* i370-*-* c4x-*-* } 3 } */
|
||||
/* { dg-warning "does not support infinity" "INF unsupported" { target vax-*-* i370-*-* c4x-*-* } 4 } */
|
||||
/* { dg-warning "does not support infinity" "INF unsupported" { target vax-*-* i370-*-* c4x-*-* } 5 } */
|
Loading…
Add table
Reference in a new issue