Commit forgotten testecase for pr71727.
authorChristophe Lyon <clyon@gcc.gnu.org>
Thu, 28 Sep 2017 12:59:44 +0000 (14:59 +0200)
committerChristophe Lyon <clyon@gcc.gnu.org>
Thu, 28 Sep 2017 12:59:44 +0000 (14:59 +0200)
From-SVN: r253251

gcc/testsuite/gcc.target/aarch64/pr71727-2.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.target/aarch64/pr71727-2.c b/gcc/testsuite/gcc.target/aarch64/pr71727-2.c
new file mode 100644 (file)
index 0000000..2bc803a
--- /dev/null
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-mstrict-align -O3" } */
+
+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 } } */