[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gcc.dg / sms-4.c
blob0dc1de2611d031b467a5af084c9d2aa86b09f875
1 /* Inspired from bitmap_or_and 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*-*-* } } */
6 extern void abort (void);
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 };
13 __attribute__ ((noinline))
14 void
15 foo (int size, int *ap, int *bp, int *cp, int *dstp)
17 unsigned int i, n = size;
18 int changed = 0;
20 for (i = 0; i < n; i++)
22 const int tmp = *ap++ | (*bp++ & *cp++);
23 changed |= *dstp ^ tmp;
24 *dstp++ = tmp;
27 if (changed == 0)
28 abort ();
31 int
32 main ()
34 foo (5, a, b, c, dst);
35 return 0;
38 /* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target spu-*-* powerpc*-*-* } } } */