(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
s390/
vector/
vec-abi-struct-1.c
       1  /* Check calling convention in the vector ABI.  */
       2  
       3  /* { dg-do compile { target { s390*-*-* } } } */
       4  /* { dg-options "-O3 -mzarch -march=z13" } */
       5  
       6  /* c.i and c.j are passed by reference since a struct with two
       7     elements is no vector type argument.  */
       8  /* { dg-final { scan-assembler "ld\t%v\[0-9\]*,0\\(%r3\\)" } } */
       9  /* { dg-final { scan-assembler "ld\t%v\[0-9\]*,8\\(%r3\\)" } } */
      10  
      11  /* just_v2si is passed in a vector reg if it as an incoming arg.
      12     However, as return value it is passed via hidden first pointer
      13     argument.  */
      14  /* { dg-final { scan-assembler ".*st.*\t%v\[0-9\]*,0\\(%r2\\)" } } */
      15  
      16  /* { dg-final { scan-assembler "gnu_attribute 8, 2" } } */
      17  
      18  typedef int __attribute__ ((vector_size(8))) v2si;
      19  
      20  struct just_v2si
      21  {
      22    v2si i;
      23  };
      24  
      25  struct two_v2si
      26  {
      27    v2si i, j;
      28  };
      29  
      30  struct just_v2si
      31  add_structvecs (v2si a, struct just_v2si b, struct two_v2si c)
      32  {
      33    struct just_v2si res;
      34  
      35    res.i = a + b.i + c.i + c.j;
      36    return res;
      37  }