OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [powerpc/] [pr46728-3.c] - Blame information for rev 708

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt" } */
3
 
4
#include <math.h>
5
 
6
extern void abort (void);
7
 
8
#define NVALS 6
9
 
10
static double
11
convert_it (double x)
12
{
13
  return pow (x, 0.75);
14
}
15
 
16
int
17
main (int argc, char *argv[])
18
{
19
  double values[NVALS] = { 3.0, 1.95, 2.227, 4.0, 256.0, .0008797 };
20
  unsigned i;
21
 
22
  for (i = 0; i < NVALS; i++)
23
    if (convert_it (values[i]) != sqrt(values[i]) * sqrt (sqrt (values[i])))
24
      abort ();
25
 
26
  return 0;
27
}
28
 
29
 
30
/* { dg-final { scan-assembler-times "sqrt" 4 { target powerpc*-*-* } } } */
31
/* { dg-final { scan-assembler-not "pow" { target powerpc*-*-* } } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.