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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [ultrasp9.c] - Rev 823

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

/* PR optimization/11018 */
/* Originator: <partain@dcs.gla.ac.uk> */
/* { dg-do run { target sparc*-*-* } } */
/* { dg-options "-O2 -mcpu=ultrasparc" } */
 
/* This used to fail on 32-bit Ultrasparc because
   of broken DImode shift patterns.  */
 
extern void abort(void);
 
typedef unsigned long long uint64_t;
typedef unsigned int size_t;
 
 
void to_octal (uint64_t value, char *where, size_t size)
{
  uint64_t v = value;
  size_t i = size;
 
  do
    {
      where[--i] = '0' + (v & ((1 << 3) - 1));
      v >>= 3;
    }
  while (i);
}
 
 
int main (void)
{
  char buf[8];
 
  to_octal(010644, buf, 6);
 
  if (buf[1] != '1')
     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.