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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.warn/] [compare1.C] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
// { dg-do assemble  }
2
// { dg-options "-ansi -pedantic-errors -Wsign-compare -Wno-deprecated" }
3
 
4
// Copyright (C) 2001 Free Software Foundation, Inc.
5
// Contributed by Kaveh R. Ghazi  5/13/2001
6
 
7
int foo(int x, int y, unsigned u)
8
{
9
  /* A MAX_EXPR is non-negative if EITHER argument to the MAX_EXPR is
10
     determined to be non-negative.  */
11
  if (u < (x >? -1)) // { dg-warning "" } signed and unsigned
12
    return x;
13
  if (u < (x >? 10))
14
    return x;
15
  if ((10 >? x) < u)
16
    return x;
17
  if (u < (x >? (y ? (x==y) : 10)))
18
    return x;
19
  if (((y ? 10 : (x==y)) >? x) < u)
20
    return x;
21
 
22
  /* A MIN_EXPR is non-negative if BOTH arguments to the MIN_EXPR are
23
     determined to be non-negative.  */
24
  if (u < ((x?11:8) 
25
    return x;
26
  if (u < ((x?11:8) 
27
    return x;
28
  if ((10 
29
    return x;
30
  if (u < ((x?11:(x==y)) 
31
    return x;
32
  if ((10 
33
    return x;
34
 
35
  return 0;
36
}

powered by: WebSVN 2.1.0

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