1  /* Disabling epilogues until we find a better way to deal with scans.  */
       2  /* { dg-additional-options "--param vect-epilogues-nomask=0" } */
       3  /* { dg-require-effective-target vect_float_strict } */
       4  /* { dg-additional-options "-fno-fast-math" } */
       5  
       6  #include <stdarg.h>
       7  #include "tree-vect.h"
       8  
       9  #define N 16
      10  #define DIFF 242
      11  
      12  __attribute__ ((noinline))
      13  int main1 (float x, float max_result)
      14  {
      15    int i;
      16    float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
      17    float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
      18    float diff = 2;
      19    float max = x;
      20    float min = 10;
      21  
      22    for (i = 0; i < N; i++) {
      23      diff += (b[i] - c[i]);
      24    }
      25  
      26    for (i = 0; i < N; i++) {
      27      max = max < c[i] ? c[i] : max;
      28    }
      29  
      30    for (i = 0; i < N; i++) {
      31      min = min > c[i] ? c[i] : min;
      32    }
      33  
      34    /* check results:  */
      35    if (diff != DIFF)
      36      abort ();
      37    if (max != max_result)
      38      abort ();
      39    if (min != 0)
      40      abort ();
      41  
      42    return 0;
      43  }
      44  
      45  int main (void)
      46  { 
      47    check_vect ();
      48    
      49    main1 (100 ,100);
      50    main1 (0, 15);
      51    return 0;
      52  }
      53  
      54  /* { dg-final { scan-tree-dump-times {using an in-order \(fold-left\) reduction} 1 "vect" } } */
      55  /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */