* expmed.c (flip_storage_order): Deal with complex modes specially.
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 20010910-1.c
blob185e29d2b2875e4d61c96f8c8246f0ca018a9fe4
1 /* Test case contributed by Ingo Rohloff <rohloff@in.tum.de>.
2 Code distilled from Linux kernel. */
4 /* Compile this program with a gcc-2.95.2 using
5 "gcc -O2" and run it. The result will be that
6 rx_ring[1].next == 0 (it should be == 14)
7 and
8 ep.skbuff[4] == 5 (it should be 0)
9 */
11 extern void abort(void);
13 struct epic_rx_desc
15 unsigned int next;
18 struct epic_private
20 struct epic_rx_desc *rx_ring;
21 unsigned int rx_skbuff[5];
24 static void epic_init_ring(struct epic_private *ep)
26 int i;
28 for (i = 0; i < 5; i++)
30 ep->rx_ring[i].next = 10 + (i+1)*2;
31 ep->rx_skbuff[i] = 0;
33 ep->rx_ring[i-1].next = 10;
36 static int check_rx_ring[5] = { 12,14,16,18,10 };
38 int main(void)
40 struct epic_private ep;
41 struct epic_rx_desc rx_ring[5];
42 int i;
44 for (i=0;i<5;i++)
46 rx_ring[i].next=0;
47 ep.rx_skbuff[i]=5;
50 ep.rx_ring=rx_ring;
51 epic_init_ring(&ep);
53 for (i=0;i<5;i++)
55 if ( rx_ring[i].next != check_rx_ring[i] ) abort();
56 if ( ep.rx_skbuff[i] != 0 ) abort();
58 return 0;