1 /* { dg-do compile } */
2 /* { dg-additional-options "-Wno-pedantic -Wno-long-long -m64" } */
3 
4 /* Struct return.  Returned 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_rone \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
13 one dcl_rone (void);
14 
15 /* { dg-final { scan-assembler-times ".extern .func dcl_rtwo \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
16 two dcl_rtwo (void);
17 
18 /* { dg-final { scan-assembler-times ".extern .func dcl_rfour \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
19 four dcl_rfour (void);
20 
21 /* { dg-final { scan-assembler-times ".extern .func dcl_reight \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
22 eight dcl_reight (void);
23 
24 /* { dg-final { scan-assembler-times ".extern .func dcl_rbig \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
25 big dcl_rbig (void);
26 
test_1(void)27 void test_1 (void)
28 {
29   dcl_rone ();
30   dcl_rtwo ();
31   dcl_rfour ();
32   dcl_reight ();
33   dcl_rbig ();
34 }
35 
36 #define M(T, v) ({T t; t.a = v; t;})
37 
38 /* { dg-final { scan-assembler-times ".visible .func dfn_rone \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
dfn_rone(void)39 one dfn_rone (void)
40 {
41   return M (one, 1);
42 }
43 
44 /* { dg-final { scan-assembler-times ".visible .func dfn_rtwo \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
dfn_rtwo(void)45 two dfn_rtwo (void)
46 {
47   return M (two, 2);
48 }
49 
50 /* { dg-final { scan-assembler-times ".visible .func dfn_rfour \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
dfn_rfour(void)51 four dfn_rfour (void)
52 {
53   return M (four, 3);
54 }
55 
56 /* { dg-final { scan-assembler-times ".visible .func dfn_reight \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
dfn_reight(void)57 eight dfn_reight (void)
58 {
59   return M (eight, 4);
60 }
61 
62 /* { dg-final { scan-assembler-times ".visible .func dfn_rbig \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
dfn_rbig(void)63 big dfn_rbig (void)
64 {
65   return M (big, 5);
66 }
67