OSDN Git Service

* gcc.dg/testsuite/c++98.c,c++98-pedantic.c,c89.c,c89-pedantic.c,
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / 20000720-1.c
1 /* { dg-do compile { target i?86-*-* } } */
2 /* { dg-options "-mpreferred-stack-boundary=2 -march=i586 -O2 -fomit-frame-pointer" } */
3
4 extern void *foo(void *a, const void *b, unsigned c);
5
6 extern inline void *
7 bar(void *a, const void *b, unsigned c)
8 {
9   int d0, d1, d2;
10   __asm__ __volatile__(
11     "" :
12     "=&c" (d0), "=&D" (d1), "=&S" (d2) :
13     "0" (c/4), "q" (c), "1" (a), "2" (b) :
14     "memory");
15   return a;
16 }
17
18 typedef struct {
19   unsigned char a;
20   unsigned b : 2;
21   unsigned c : 4;
22   unsigned d : 2;
23 } *baz;
24
25 static int
26 dead(unsigned short *v, char *w, unsigned char *x, int y, int z)
27 {
28   int i = 0;
29   unsigned short j = *v;
30
31   while (y > 0) {
32     ((baz)x)->a = j;
33     ((baz)x)->b = 0;
34     ((baz)x)->c = 0;
35     ((baz)x)->d = 0;
36     __builtin_constant_p(i) ? foo(x, w, i) : bar(x, w, i);
37   }
38   return z - y;
39 }