testsuite: Fix gcc.dg/vect/pr65947-7.c
authorRichard Sandiford <richard.sandiford@arm.com>
Fri, 9 Apr 2021 12:43:17 +0000 (13:43 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Fri, 9 Apr 2021 12:43:17 +0000 (13:43 +0100)
This test was failing on aarch64 targets because we inlined the
test function into main, making it vectorisable.

gcc/testsuite/
* gcc.dg/vect/pr65947-7.c: Add a noipa attribute.  Expect the
loop to vectorized if vect_fold_extract_last.

gcc/testsuite/gcc.dg/vect/pr65947-7.c

index 287f57e..16cdcd1 100644 (file)
@@ -9,7 +9,7 @@ extern void abort (void) __attribute__ ((noreturn));
 /* Condition reduction with comparison is a different type to the data.  Will
    fail to vectorize.  */
 
-int
+int __attribute__ ((noipa))
 condition_reduction (short *a, int min_v, int *b)
 {
   int last = N + 65;
@@ -52,4 +52,5 @@ main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" } } */
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target vect_fold_extract_last } } } */
+/* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" { target { ! vect_fold_extract_last } } } } */