1  /* Verify that overloaded built-ins for vec_sel with short
       2     inputs produce the right code.  */
       3  
       4  /* { dg-do compile } */
       5  /* { dg-require-effective-target powerpc_vsx_ok } */
       6  /* { dg-options "-maltivec -O2" } */
       7  
       8  #include <altivec.h>
       9  
      10  vector bool short
      11  test1_0 (vector bool short x, vector bool short y, vector bool short z)
      12  {
      13    return vec_sel (x, y, z);
      14  }
      15  
      16  vector bool short
      17  test1_1 (vector bool short x, vector bool short y, vector unsigned short z)
      18  {
      19    return vec_sel (x, y, z);
      20  }
      21  
      22  vector signed short
      23  test3_0 (vector signed short x, vector signed short y, vector bool short z)
      24  {
      25    return vec_sel (x, y, z);
      26  }
      27  
      28  vector signed short
      29  test3_1 (vector signed short x, vector signed short y, vector unsigned short z)
      30  {
      31    return vec_sel (x, y, z);
      32  }
      33  
      34  vector unsigned short
      35  test6_0 (vector unsigned short x, vector unsigned short y, vector bool short z)
      36  {
      37    return vec_sel (x, y, z);
      38  }
      39  
      40  vector unsigned short
      41  test6_1 (vector unsigned short x, vector unsigned short y, vector unsigned short z)
      42  {
      43    return vec_sel (x, y, z);
      44  }
      45  
      46  /* { dg-final { scan-assembler-times {\mxxsel\M|\mvsel\M} 6 } } */