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] - Rev 849

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

/* This was failing on Alpha because the comparison (p != -1) was rewritten
   as (p+1 != 0) and p+1 isn't allowed to wrap for pointers.  */
 
extern void abort(void);
 
typedef __SIZE_TYPE__ size_t;
 
int global;
 
static void *foo(int p)
{
  if (p == 0)
   {
      global++;
      return &global;
   }
 
  return (void *)(size_t)-1;
}
 
int bar(void)
{
  void *p;
 
  p = foo(global);
  if (p != (void *)(size_t)-1)
    return 1;
 
  global++;
  return 0;
}
 
int main(void)
{
  global = 1;
  if (bar () != 0)
    abort();
 
  return 0;
}
 

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

powered by: WebSVN 2.1.0

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