]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/sms-4.c
This patch implements the unification of the *bitmap interfaces as discussed.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / sms-4.c
CommitLineData
f61e445a 1/* Inspired from bitmap_or_and function in sbitmap.c. */
d48b46e0 2/* { dg-do run } */
bd639075 3/* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -fdump-rtl-sms" } */
593ba581 4/* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -fdump-rtl-sms --param sms-min-sc=1" { target powerpc*-*-* } } */
d48b46e0
RE
5
6extern void abort (void);
7
8int a[5] = { 0, 1, 0, 0, 0 };
9int b[5] = { 0, 1, 0, 1, 0 };
10int c[5] = { 0, 0, 1, 1, 0 };
11int dst[5] = { 0, 0, 0, 0, 0 };
12
bd639075 13__attribute__ ((noinline))
d48b46e0
RE
14void
15foo (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
31int
32main ()
33{
34 foo (5, a, b, c, dst);
35 return 0;
36}
37
bd639075
RE
38/* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target spu-*-* powerpc*-*-* } } } */
39/* { dg-final { cleanup-rtl-dump "sms" } } */
40