1 /* { dg-do compile } */
2 /* { dg-additional-options "-Wno-pedantic -Wno-long-long -m64" } */
3 
4 /* Scalar return types.  In registers when <= 64 bit.  */
5 
6 typedef int __attribute__((mode(TI))) ti;
7 
8 /* { dg-final { scan-assembler-times ".extern .func dcl_rv;" 1 } } */
9 void dcl_rv (void);
10 
11 /* { dg-final { scan-assembler-times ".extern .func \\(.param.u32 %\[_a-z\]*\\) dcl_rc;" 1 } } */
12 char dcl_rc (void);
13 
14 /* { dg-final { scan-assembler-times ".extern .func \\(.param.u32 %\[_a-z\]*\\) dcl_rs;" 1 } } */
15 short dcl_rs (void);
16 
17 /* { dg-final { scan-assembler-times ".extern .func \\(.param.u32 %\[_a-z\]*\\) dcl_ri;" 1 } } */
18 int dcl_ri (void);
19 
20 /* { dg-final { scan-assembler-times ".extern .func \\(.param.u64 %\[_a-z\]*\\) dcl_rll;" 1 } } */
21 long long dcl_rll (void);
22 
23 /* { dg-final { scan-assembler-times ".extern .func dcl_rti \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
24 ti dcl_rti (void);
25 
26 /* { dg-final { scan-assembler-times ".extern .func \\(.param.f32 %\[_a-z\]*\\) dcl_rf;" 1 } } */
27 float dcl_rf (void);
28 
29 /* { dg-final { scan-assembler-times ".extern .func \\(.param.f64 %\[_a-z\]*\\) dcl_rd;" 1 } } */
30 double dcl_rd (void);
31 
32 /* { dg-final { scan-assembler-times ".extern .func \\(.param.u64 %\[_a-z\]*\\) dcl_rp;" 1 } } */
33 void *dcl_rp (void);
34 
test_1(void)35 void test_1 (void)
36 {
37   dcl_rv ();
38   dcl_rc ();
39   dcl_rs ();
40   dcl_ri ();
41   dcl_rll ();
42   dcl_rti ();
43   dcl_rf ();
44   dcl_rd ();
45   dcl_rp ();
46 }
47 
48 /* { dg-final { scan-assembler-times ".visible .func dfn_rv(?:;|\[\r\n\]+\{)" 2 } } */
dfn_rv(void)49 void dfn_rv (void)
50 {
51   return;
52 }
53 
54 /* { dg-final { scan-assembler-times ".visible .func \\(.param.u32 %\[_a-z0-9\]*\\) dfn_rc(?:;|\[\r\n\]+\{)" 2 } } */
dfn_rc(void)55 char dfn_rc (void)
56 {
57   return 1;
58 }
59 
60 /* { dg-final { scan-assembler-times ".visible .func \\(.param.u32 %\[_a-z0-0\]*\\) dfn_rs(?:;|\[\r\n\]+\{)" 2 } } */
dfn_rs(void)61 short dfn_rs (void)
62 {
63   return 2;
64 }
65 
66 /* { dg-final { scan-assembler-times ".visible .func \\(.param.u32 %\[_a-z0-9\]*\\) dfn_ri(?:;|\[\r\n\]+\{)" 2 } } */
dfn_ri(void)67 int dfn_ri (void)
68 {
69   return 3;
70 }
71 
72 /* { dg-final { scan-assembler-times ".visible .func \\(.param.u64 %\[_a-z0-9\]*\\) dfn_rll(?:;|\[\r\n\]+\{)" 2 } } */
dfn_rll(void)73 long long dfn_rll (void)
74 {
75   return 4;
76 }
77 
78 /* { dg-final { scan-assembler-times ".visible .func dfn_rti \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
dfn_rti(void)79 ti dfn_rti (void)
80 {
81   return 5;
82 }
83 
84 /* { dg-final { scan-assembler-times ".visible .func \\(.param.f32 %\[_a-z0-9\]*\\) dfn_rf(?:;|\[\r\n\]+\{)" 2 } } */
dfn_rf(void)85 float dfn_rf (void)
86 {
87   return 6;
88 }
89 
90 /* { dg-final { scan-assembler-times ".visible .func \\(.param.f64 %\[_a-z0-9\]*\\) dfn_rd(?:;|\[\r\n\]+\{)" 2 } } */
dfn_rd(void)91 double dfn_rd (void)
92 {
93   return 7;
94 }
95 
96 /* { dg-final { scan-assembler-times ".visible .func \\(.param.u64 %\[_a-z0-9\]*\\) dfn_rp(?:;|\[\r\n\]+\{)" 2 } } */
dfn_rp(void)97 void *dfn_rp (void)
98 {
99   return 0;
100 }
101