OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [20030414-2.c] - Blame information for rev 149

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 constant folding (c1 - x) op c2 into x swap(op) c1-c2
4
   doesn't break anything.
5
 
6
   Written by Roger Sayle, 27th March 2003.  */
7
 
8
/* { dg-do run } */
9
/* { dg-options "-O2 -ffast-math" } */
10
 
11
extern void abort (void);
12
 
13
int foo(double x)
14
{
15
  return (10.0 - x) > 3.0;
16
}
17
 
18
int bar (double x)
19
{
20
  return (10.0 - x) == 5.0;
21
}
22
 
23
int main()
24
{
25
  if (foo (8.0))
26
    abort ();
27
 
28
  if (! foo (6.0))
29
    abort ();
30
 
31
  if (bar (1.0))
32
    abort ();
33
 
34
  if (! bar (5.0))
35
    abort ();
36
  return 0;
37
}
38
 

powered by: WebSVN 2.1.0

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