summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/vect/slp-pr56812.cc
blob: 9b2fcc683c3f8722ee0ed7c66d342b207b63da2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do compile } */
/* { dg-require-effective-target vect_float } */
/* { dg-require-effective-target vect_hw_misalign } */
/* { dg-additional-options "-O3 -funroll-loops -fvect-cost-model" } */

class mydata {
public:
    mydata() {Set(-1.0);}
    void Set (float);
    static int upper() {return 8;}
    float data[8];
};

void mydata::Set (float x)
{
  for (int i=0; i<upper(); i++)
    data[i] = x;
}

/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" } } */
/* { dg-final { cleanup-tree-dump "slp" } } */