1  /* { dg-do compile } */
       2  /* { dg-options "-O2 -mavx2 -fdump-tree-forwprop1" } */
       3  
       4  typedef double v4df __attribute__((vector_size (32)));
       5  typedef double v2df __attribute__((vector_size (16)));
       6  typedef short v16hi __attribute__((vector_size (32)));
       7  typedef short v8hi __attribute__((vector_size (16)));
       8  
       9  v2df
      10  foo (v4df x, double *p)
      11  {
      12    return (v2df) { x[1], *p };
      13  }
      14  
      15  v2df
      16  bar (v4df x, double *p)
      17  {
      18    return (v2df) { x[0], *p }; /* BIT_INSERT_EXPR */
      19  }
      20  
      21  v2df
      22  baz (v2df x, double *p)
      23  {
      24    return (v2df) { x[1], *p }; /* VEC_PERM_EXPR */
      25  }
      26  
      27  v2df
      28  qux (v2df x, double *p)
      29  {
      30    return (v2df) { x[0], *p }; /* BIT_INSERT_EXPR */
      31  }
      32  
      33  v2df
      34  corge (v4df x, double *p)
      35  {
      36    return (v2df) { x[3], *p };
      37  }
      38  
      39  /* { dg-final { scan-tree-dump-times "BIT_INSERT_EXPR" 2 "forwprop1" } } */
      40  /* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 1 "forwprop1" } } */
      41  /* We can't check for 1:1 assembler here so check for what we do not
      42     want to see.  */
      43  /* { dg-final { scan-assembler-not { "perm" } } } */
      44  /* { dg-final { scan-assembler-not { "insert" } } } */
      45  /* { dg-final { scan-assembler-not { "broadcast" } } } */