(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
nvptx/
abi-struct-arg.c
       1  /* { dg-do compile } */
       2  /* { dg-additional-options "-Wno-pedantic -Wno-long-long -m64" } */
       3  
       4  /* Struct arg.  Passed via pointer.  */
       5  
       6  typedef struct {char a;} one;
       7  typedef struct {short a;} two;
       8  typedef struct {int a;} four;
       9  typedef struct {long long a;} eight;
      10  typedef struct {int a, b[12];} big;
      11  
      12  /* { dg-final { scan-assembler-times ".extern .func dcl_aone \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      13  void dcl_aone (one);
      14  
      15  /* { dg-final { scan-assembler-times ".extern .func dcl_atwo \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      16  void dcl_atwo (two);
      17  
      18  /* { dg-final { scan-assembler-times ".extern .func dcl_afour \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      19  void dcl_afour (four);
      20  
      21  /* { dg-final { scan-assembler-times ".extern .func dcl_aeight \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      22  void dcl_aeight (eight);
      23  
      24  /* { dg-final { scan-assembler-times ".extern .func dcl_abig \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      25  void dcl_abig (big);
      26  
      27  #define M(T, v) ({T t; t.a = v; t;})
      28  
      29  void test_1 (void)
      30  {
      31    dcl_aone (M (one, 1));
      32    dcl_atwo (M (two, 2));
      33    dcl_afour (M (four, 3));
      34    dcl_aeight (M (eight, 4));
      35    dcl_abig (M (big, 5));
      36  }
      37  
      38  /* { dg-final { scan-assembler-times ".visible .func dfn_aone \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
      39  void dfn_aone (one one)
      40  {
      41  }
      42  
      43  /* { dg-final { scan-assembler-times ".visible .func dfn_atwo \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
      44  void dfn_atwo (two two)
      45  {
      46  }
      47  
      48  /* { dg-final { scan-assembler-times ".visible .func dfn_afour \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
      49  void dfn_afour (four four)
      50  {
      51  }
      52  
      53  /* { dg-final { scan-assembler-times ".visible .func dfn_aeight \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
      54  void dfn_aeight (eight eight)
      55  {
      56  }
      57  
      58  /* { dg-final { scan-assembler-times ".visible .func dfn_abig \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
      59  void dfn_abig (big big)
      60  {
      61  }
      62