1  /* { dg-do run } */
       2  /* { dg-options "-O3 -mzarch -march=z13 -mzvector --save-temps" } */
       3  
       4  #include <vecintrin.h>
       5  
       6  vector signed char __attribute__((noinline,noclone))
       7  foo8 (vector signed char a)
       8  {
       9    return vec_sldw (a, (vector signed char){ 0 }, 2);
      10  }
      11  
      12  vector signed short __attribute__((noinline,noclone))
      13  foo16 (vector signed short a)
      14  {
      15    return vec_sldw (a, (vector signed short){ 0 }, 2);
      16  }
      17  
      18  vector int __attribute__((noinline,noclone))
      19  foo32 (vector int a)
      20  {
      21    return vec_sldw (a, (vector int){ 0 }, 2);
      22  }
      23  
      24  vector long long __attribute__((noinline,noclone))
      25  foo64 (vector long long a)
      26  {
      27    return vec_sldw (a, (vector long long){ 0 }, 2);
      28  }
      29  
      30  int
      31  main ()
      32  {
      33    vector long long x;
      34  
      35    x = (vector long long)foo8 ((vector signed char)
      36  	 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 });
      37    if (x[0] != 0x08090a0b0c0d0e0fULL || x[1] != 0)
      38      __builtin_abort ();
      39  
      40    x = (vector long long)foo16 ((vector signed short){ 0, 1, 2, 3, 4, 5, 6, 7 });
      41    if (x[0] != 0x0004000500060007ULL || x[1] != 0)
      42      __builtin_abort ();
      43  
      44    x = (vector long long)foo32 ((vector int){ 0, 1, 2, 3 });
      45    if (x[0] != 0x0000000200000003ULL || x[1] != 0)
      46      __builtin_abort ();
      47  
      48    x = (vector long long)foo64 ((vector long long){ 0, 1 });
      49    if (x[0] != 1 || x[1] != 0)
      50      __builtin_abort ();
      51  
      52    return 0;
      53  }
      54  
      55  /* { dg-final { scan-assembler "vsldb\t%v24,%v24,%v\[0-9\]*,8" } } */