OSDN Git Service

2008-04-27 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / sms-4.c
1 /* Inspired from sbitmap_a_or_b_and_c_cg function in sbitmap.c.  */
2 /* { dg-do run } */
3 /* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves" } */
4
5 extern void abort (void);
6
7 int a[5] = { 0, 1, 0, 0, 0 };
8 int b[5] = { 0, 1, 0, 1, 0 };
9 int c[5] = { 0, 0, 1, 1, 0 };
10 int dst[5] = { 0, 0, 0, 0, 0 };
11
12 void
13 foo (int size, int *ap, int *bp, int *cp, int *dstp)
14 {
15   unsigned int i, n = size;
16   int changed = 0;
17
18   for (i = 0; i < n; i++)
19     {
20       const int tmp = *ap++ | (*bp++ & *cp++);
21       changed |= *dstp ^ tmp;
22       *dstp++ = tmp;
23     }
24
25   if (changed == 0)
26     abort ();
27 }
28
29 int
30 main ()
31 {
32   foo (5, a, b, c, dst);
33   return 0;
34 }
35