Debian Codegraph @

gcc/testsuite/gcc.target/sparc/ultrasp9.c

raw
1 /* PR optimization/11018 */
2 /* Originator: <[email protected]> */
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 }