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/] [pr7284-1.c] - Rev 816

Compare with Previous | Blame | View Log

/* Signed left-shift is implementation-defined in C89 (and see
   DR#081), not undefined.  Bug 7284 from Al Grant (AlGrant at
   myrealbox.com).  */
 
/* { dg-options "-std=c89" } */
 
extern void abort (void);
extern void exit (int);
 
int
f (int n)
{
  return (n << 24) / (1 << 23);
}
 
volatile int x = 128;
 
int
main (void)
{
  if (f(x) != -256)
    abort ();
  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.