1  /* { dg-require-ifunc "" } */
       2  /* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } } */
       3  /* { dg-require-effective-target avx512f } */
       4  /* { dg-options "-O2" } */
       5  
       6  static double bar (double *__restrict, double *__restrict, int)
       7  __attribute__ ((target_clones("avx,avx2,avx512f,default")));
       8  
       9  double
      10  foo (double *__restrict a, double *__restrict b, int n)
      11  {
      12    return bar (a,b,n);
      13  }
      14  
      15  double
      16  bar (double *__restrict a, double *__restrict b, int n)
      17  {
      18    double s;
      19    int i;
      20    s = 0.0;
      21    for (i=0; i<n; i++)
      22      s += a[i] + b[i];
      23  
      24    return s;
      25  }
      26  
      27  #define N 5
      28  
      29  int main ()
      30  {
      31    double a[N] = {1.2f, 1.2f, 1.2f, 1.2f, 1.2f };
      32    double b[N] = {1.2f, 1.2f, 1.2f, 1.2f, 1.2f };
      33  
      34    __builtin_printf ("value: %.5f\n", foo (a, b, N));
      35    return 0;
      36  }