OSDN Git Service

2010-02-09 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / pr42249.c
1 /* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
2 /* { dg-options "-O2 -fselective-scheduling -fsel-sched-pipelining" } */
3
4 typedef struct TypHeader
5 {
6   unsigned long size;
7   struct TypHeader **ptr;
8 } *TypHandle;
9
10 extern TypHandle NewBag (unsigned int type, unsigned long size);
11 typedef unsigned long TypPoint32;
12
13 TypHandle
14 QuoPP (TypHandle hdL, TypHandle hdR)
15 {
16   TypHandle hdC;
17   unsigned long degC;
18   TypPoint32 *ptC;
19   unsigned long degL;
20   TypPoint32 *ptL;
21   unsigned long degR;
22   TypPoint32 *ptR;
23   unsigned long p;
24
25   degL = ((hdL)->size) / sizeof (TypPoint32);
26   degR = ((hdR)->size) / sizeof (TypPoint32);
27   degC = degL < degR ? degR : degL;
28   hdC = NewBag (9, (unsigned long) (degC * sizeof (TypPoint32)));
29   ptC = (TypPoint32 *) ((TypHandle *) ((hdC)->ptr));
30
31   for (p = 0; p < degC; p++)
32     ptC[(((p) < (degR)) ? (ptR)[(p)] : (p))] =
33       ((((((p) < (degL)) ? (ptL)[(p)] : (p))) <
34         (degR)) ? (ptR)[((((p) < (degL)) ? (ptL)[(p)] : (p)))]
35        : ((((p) < (degL)) ? (ptL)[(p)] : (p))));
36 }
37