(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
torture/
stackalign/
ret-struct-1.c
       1  /* { dg-do run } */
       2  /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */
       3  /* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } } */
       4  
       5  #include "check.h"
       6  
       7  #ifndef ALIGNMENT
       8  #define ALIGNMENT       64
       9  #endif
      10  
      11  extern void abort();
      12  typedef struct my_struct
      13  {
      14  	char str[31];
      15  } stype ;
      16  
      17  stype g_s;
      18  
      19  stype __attribute__((noinline))
      20  foo (char arg1, char arg2, char arg3)
      21  {
      22  	stype __attribute__((aligned(ALIGNMENT))) s;
      23  	s.str[0] = arg1;
      24  	s.str[1] = arg2;
      25  	s.str[30] = arg3;
      26  	check(&s, ALIGNMENT);
      27  	return s;
      28  }
      29  
      30  int main()
      31  {
      32  	g_s = foo(1,2,3);
      33  
      34  	if (g_s.str[0] != 1 || g_s.str[1] != 2 || g_s.str[30] !=3)
      35  	  abort();
      36  	return 0;
      37  }