aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64/pr71727-2.c
blob: 58fe5bcd59c80ef78cca9e10f01b978023420e0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* { dg-do compile } */
/* { dg-options "-mstrict-align -O3" } */

#pragma GCC target "+nosve"

unsigned char foo(const unsigned char *buffer, unsigned int length)
{
  unsigned char sum;
  unsigned int  count;

  for (sum = 0, count = 0; count < length; count++) {
    sum = (unsigned char) (sum + *(buffer + count));
  }

  return sum;
}

/* { dg-final { scan-assembler-times "and\tw\[0-9\]+, w\[0-9\]+, 15" 1 } } */