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/] [960311-3.c] - Rev 816

Compare with Previous | Blame | View Log

#include <stdio.h>
 
#ifdef DEBUG
#define abort() printf ("error, line %d\n", __LINE__)
#endif
 
int count;
 
void a1() { ++count; }
 
void
b (unsigned long data)
{
  if (data & 0x80000000) a1();
  data <<= 1;
 
  if (data & 0x80000000) a1();
  data <<= 1;
 
  if (data & 0x80000000) a1();
}
 
main ()
{
  count = 0;
  b (0);
  if (count != 0)
    abort ();
 
  count = 0;
  b (0x80000000);
  if (count != 1)
    abort ();
 
  count = 0;
  b (0x40000000);
  if (count != 1)
    abort ();
 
  count = 0;
  b (0x20000000);
  if (count != 1)
    abort ();
 
  count = 0;
  b (0xc0000000);
  if (count != 2)
    abort ();
 
  count = 0;
  b (0xa0000000);
  if (count != 2)
    abort ();
 
  count = 0;
  b (0x60000000);
  if (count != 2)
    abort ();
 
  count = 0;
  b (0xe0000000);
  if (count != 3)
    abort ();
 
#ifdef DEBUG
  printf ("Done.\n");
#endif
  exit (0);
}
 

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.