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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20041112-1.c] - Blame information for rev 774

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

Line No. Rev Author Line
1 688 jeremybenn
/* This was failing on Alpha because the comparison (p != -1) was rewritten
2
   as (p+1 != 0) and p+1 isn't allowed to wrap for pointers.  */
3
 
4
extern void abort(void);
5
 
6
typedef __SIZE_TYPE__ size_t;
7
 
8
int global;
9
 
10
static void *foo(int p)
11
{
12
  if (p == 0)
13
   {
14
      global++;
15
      return &global;
16
   }
17
 
18
  return (void *)(size_t)-1;
19
}
20
 
21
int bar(void)
22
{
23
  void *p;
24
 
25
  p = foo(global);
26
  if (p != (void *)(size_t)-1)
27
    return 1;
28
 
29
  global++;
30
  return 0;
31
}
32
 
33
int main(void)
34
{
35
  global = 1;
36
  if (bar () != 0)
37
    abort();
38
 
39
  return 0;
40
}

powered by: WebSVN 2.1.0

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