aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/builtins-52.c
blob: 684fd661de8c5782c5f30ec6d21cc3e1e545b5d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do link } */
/* { dg-options "-ffast-math" } */

extern void link_error(void);

void test(double x, int n)
{
  if (__builtin_powi(x,-1.0) != 1.0/x)
    link_error ();
  if (__builtin_powi(x,0.0) != 1.0)
    link_error ();
  if (__builtin_powi(x,1.0) != x)
    link_error ();
  if (__builtin_powi(1.0,n) != 1.0)
    link_error ();
}

int main()
{
  test(7.3, 2);
  return 0;
}