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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [pr27302-2.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-fstrict-overflow" } */
3
 
4
extern void link_error (void);
5
 
6
void test0 (int a, int b)
7
{
8
  if ((a < b) != (b > a))
9
    link_error ();
10
 
11
  if ((a - 1 < b) != (a <= b))
12
    link_error ();
13
  if ((a - 2 < b) != (a - 1 <= b))
14
    link_error ();
15
  if ((a + -1 < b) != (a <= b))
16
    link_error ();
17
  if ((a + -2 < b) != (a + -1 <= b))
18
    link_error ();
19
 
20
  if ((a + 1 > b) != (a >= b))
21
    link_error ();
22
  if ((a + 2 > b) != (a + 1 >= b))
23
    link_error ();
24
  if ((a - -1 > b) != (a >= b))
25
    link_error ();
26
  if ((a - -2 > b) != (a - -1 >= b))
27
    link_error ();
28
 
29
  if ((a + 1 <= b) != (a < b))
30
    link_error ();
31
  if ((a + 2 <= b) != (a + 1 < b))
32
    link_error ();
33
  if ((a - -1 <= b) != (a < b))
34
    link_error ();
35
  if ((a - -2 <= b) != (a - -1 < b))
36
    link_error ();
37
 
38
  if ((a - 1 >= b) != (a > b))
39
    link_error ();
40
  if ((a - 2 >= b) != (a - 1 > b))
41
    link_error ();
42
  if ((a + -1 >= b) != (a > b))
43
    link_error ();
44
  if ((a + -2 >= b) != (a + -1 > b))
45
    link_error ();
46
}
47
 
48
int main()
49
{
50
  test0 (1, 2);
51
  return 0;
52
}

powered by: WebSVN 2.1.0

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