OSDN Git Service

Fix PR testsuite/47013
[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 -fdump-rtl-sms" } */
4 /* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -fdump-rtl-sms --param sms-min-sc=1" { target powerpc*-*-* } } */
5
6 extern void abort (void);
7
8 int a[5] = { 0, 1, 0, 0, 0 };
9 int b[5] = { 0, 1, 0, 1, 0 };
10 int c[5] = { 0, 0, 1, 1, 0 };
11 int dst[5] = { 0, 0, 0, 0, 0 };
12
13 __attribute__ ((noinline))
14 void
15 foo (int size, int *ap, int *bp, int *cp, int *dstp)
16 {
17   unsigned int i, n = size;
18   int changed = 0;
19
20   for (i = 0; i < n; i++)
21     {
22       const int tmp = *ap++ | (*bp++ & *cp++);
23       changed |= *dstp ^ tmp;
24       *dstp++ = tmp;
25     }
26
27   if (changed == 0)
28     abort ();
29 }
30
31 int
32 main ()
33 {
34   foo (5, a, b, c, dst);
35   return 0;
36 }
37
38 /* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target spu-*-* powerpc*-*-* } } } */
39 /* { dg-final { cleanup-rtl-dump "sms" } } */
40