2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / ultrasp9.c
blob885420e0509c31110c0842dcd84699c0a9f177f7
1 /* PR optimization/11018 */
2 /* Originator: <partain@dcs.gla.ac.uk> */
3 /* { dg-do run { target sparc*-*-* } } */
4 /* { dg-options "-O2 -mcpu=ultrasparc" } */
6 /* This used to fail on 32-bit Ultrasparc because
7 of broken DImode shift patterns. */
9 extern void abort(void);
11 typedef unsigned long long uint64_t;
12 typedef unsigned int size_t;
15 void to_octal (uint64_t value, char *where, size_t size)
17 uint64_t v = value;
18 size_t i = size;
22 where[--i] = '0' + (v & ((1 << 3) - 1));
23 v >>= 3;
25 while (i);
29 int main (void)
31 char buf[8];
33 to_octal(010644, buf, 6);
35 if (buf[1] != '1')
36 abort();
38 return 0;