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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [builtins-21.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* Copyright (C) 2003  Free Software Foundation.
2
 
3
   Verify that built-in math function constant folding doesn't
4
   cause any problems for the compiler.
5
 
6
   Written by Roger Sayle, 7th June 2003.  */
7
 
8
/* { dg-do compile } */
9
/* { dg-options "-O2 -ffast-math" } */
10
 
11
extern double fabs (double);
12
extern float fabsf (float);
13
extern long double fabsl (long double);
14
extern double sqrt (double);
15
extern float sqrtf (float);
16
extern long double sqrtl (long double);
17
extern double exp (double);
18
extern float expf (float);
19
extern long double expl (long double);
20
 
21
double test1(double x)
22
{
23
  return fabs(x*x);
24
}
25
 
26
double test2(double x)
27
{
28
  return fabs(sqrt(x)+2.0);
29
}
30
 
31
double test3(double x)
32
{
33
  return fabs(3.0*exp(x));
34
}
35
 
36
float test1f(float x)
37
{
38
  return fabsf(x*x);
39
}
40
 
41
float test2f(float x)
42
{
43
  return fabsf(sqrtf(x)+2.0f);
44
}
45
 
46
float test3f(float x)
47
{
48
  return fabsf(3.0f*expf(x));
49
}
50
 
51
long double test1l(long double x)
52
{
53
  return fabsl(x*x);
54
}
55
 
56
long double test2l(long double x)
57
{
58
  return fabsl(sqrtl(x)+2.0l);
59
}
60
 
61
long double test3l(long double x)
62
{
63
  return fabsl(3.0l*expl(x));
64
}
65
 

powered by: WebSVN 2.1.0

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