1 /* { dg-do compile } */
2 /* { dg-require-effective-target arm_dsp } */
3 /* { dg-options "-O1 -fexpensive-optimizations -mtune=cortex-a9" } */
4 
mac(const short * a,const short * b,int sqr,int * sum)5 int mac(const short *a, const short *b, int sqr, int *sum)
6 {
7   int i;
8   int dotp = *sum;
9 
10   for (i = 0; i < 150; i++) {
11     dotp += b[i] * a[i];
12     sqr += b[i] * b[i];
13   }
14 
15   *sum = dotp;
16   return sqr;
17 }
18 
19 /* { dg-final { scan-assembler-times "smlabb" 2 } } */
20