summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/builtins-52.c
blob: 1cff017ad9466e1ff958add0003eb02c9e0f027c (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 "-O -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;
}