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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [sparc/] [ultrasp9.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 691 jeremybenn
/* PR optimization/11018 */
2
/* Originator: <partain@dcs.gla.ac.uk> */
3
 
4
/* { dg-do run } */
5
/* { dg-require-effective-target ultrasparc_hw } */
6
/* { dg-options "-O2 -mcpu=ultrasparc" } */
7
 
8
/* This used to fail on 32-bit Ultrasparc because
9
   of broken DImode shift patterns.  */
10
 
11
extern void abort(void);
12
 
13
typedef unsigned long long uint64_t;
14
typedef unsigned int size_t;
15
 
16
 
17
void to_octal (uint64_t value, char *where, size_t size)
18
{
19
  uint64_t v = value;
20
  size_t i = size;
21
 
22
  do
23
    {
24
      where[--i] = '0' + (v & ((1 << 3) - 1));
25
      v >>= 3;
26
    }
27
  while (i);
28
}
29
 
30
 
31
int main (void)
32
{
33
  char buf[8];
34
 
35
  to_octal(010644, buf, 6);
36
 
37
  if (buf[1] != '1')
38
     abort();
39
 
40
  return 0;
41
}

powered by: WebSVN 2.1.0

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