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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [builtins-24.c] - Blame information for rev 154

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

Line No. Rev Author Line
1 149 jeremybenn
/* Copyright (C) 2003 Free Software Foundation.
2
 
3
   Check that the RTL expansion of floating point exponentiation by
4
   a constant integer doesn't break anything and produces the expected
5
   results.
6
 
7
   Written by Roger Sayle, 20th June 2003.  */
8
 
9
/* { dg-do run } */
10
/* { dg-options "-O2 -ffast-math" } */
11
 
12
extern double pow(double,double);
13
extern void abort(void);
14
 
15
double foo (double x)
16
{
17
  return pow (x, 6);
18
}
19
 
20
double bar (double x)
21
{
22
  return pow (x, -4);
23
}
24
 
25
int main()
26
{
27
  if (foo (2.0) != 64.0)
28
    abort ();
29
 
30
  if (bar (2.0) != 0.0625)
31
    abort ();
32
 
33
  return 0;
34
}
35
 

powered by: WebSVN 2.1.0

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