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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [990211-1.c] - Blame information for rev 856

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

Line No. Rev Author Line
1 149 jeremybenn
/* Copyright (C) 1999 Free Software Foundation, Inc.
2
  Contributed by Nathan Sidwell 20 Jan 1999 <nathan@acm.org> */
3
 
4
/* check range combining boolean operations work */
5
 
6
extern void abort();
7
 
8
#define N 77
9
 
10
void func(int i)
11
{
12
  /* fold-const does some clever things with range tests. Make sure
13
     we get (some of) them right */
14
 
15
  /* these must fail, regardless of the value of i */
16
  if ((i < 0) && (i >= 0))
17
    abort();
18
  if ((i > 0) && (i <= 0))
19
    abort();
20
  if ((i >= 0) && (i < 0))
21
    abort();
22
  if ((i <= 0) && (i > 0))
23
    abort();
24
 
25
  if ((i < N) && (i >= N))
26
    abort();
27
  if ((i > N) && (i <= N))
28
    abort();
29
  if ((i >= N) && (i < N))
30
    abort();
31
  if ((i <= N) && (i > N))
32
    abort();
33
 
34
  /* these must pass, regardless of the value of i */
35
  if (! ((i < 0) || (i >= 0)))
36
    abort();
37
  if (! ((i > 0) || (i <= 0)))
38
    abort();
39
  if (! ((i >= 0) || (i < 0)))
40
    abort();
41
  if (! ((i <= 0) || (i > 0)))
42
    abort();
43
 
44
  if (! ((i < N) || (i >= N)))
45
    abort();
46
  if (! ((i > N) || (i <= N)))
47
    abort();
48
  if (! ((i >= N) || (i < N)))
49
    abort();
50
  if (! ((i <= N) || (i > N)))
51
    abort();
52
 
53
  return;
54
}
55
 
56
int main()
57
{
58
  func(0);
59
  func(1);
60
  return 0;
61
}

powered by: WebSVN 2.1.0

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