2017-08-28 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / nvptx / abi-vect-ret.c
blob78adf5097eb8b137e5ffed3e2b75411cd5e08dc1
1 /* { dg-do compile } */
2 /* { dg-additional-options "-Wno-pedantic -Wno-long-long -m64" } */
4 /* Vector return. Return via pointer. */
6 typedef char __attribute__ ((vector_size (1))) vc1;
7 typedef char __attribute__ ((vector_size (2))) vc2;
8 typedef char __attribute__ ((vector_size (4))) vc4;
9 typedef char __attribute__ ((vector_size (8))) vc8;
11 typedef short __attribute__ ((vector_size (2))) vs1;
12 typedef short __attribute__ ((vector_size (4))) vs2;
13 typedef short __attribute__ ((vector_size (8))) vs4;
14 typedef short __attribute__ ((vector_size (16))) vs8;
16 typedef int __attribute__ ((vector_size (4))) vi1;
17 typedef int __attribute__ ((vector_size (8))) vi2;
18 typedef int __attribute__ ((vector_size (16))) vi4;
19 typedef int __attribute__ ((vector_size (32))) vi8;
21 typedef long long __attribute__ ((vector_size (8))) vll1;
22 typedef long long __attribute__ ((vector_size (16))) vll2;
23 typedef long long __attribute__ ((vector_size (32))) vll4;
24 typedef long long __attribute__ ((vector_size (64))) vll8;
26 typedef float __attribute__ ((vector_size (4))) vf1;
27 typedef float __attribute__ ((vector_size (8))) vf2;
28 typedef float __attribute__ ((vector_size (16))) vf4;
29 typedef float __attribute__ ((vector_size (32))) vf8;
31 typedef double __attribute__ ((vector_size (8))) vd1;
32 typedef double __attribute__ ((vector_size (16))) vd2;
33 typedef double __attribute__ ((vector_size (32))) vd4;
34 typedef double __attribute__ ((vector_size (64))) vd8;
36 /* { dg-final { scan-assembler-times ".extern .func dcl_rvc1 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
37 vc1 dcl_rvc1 (void);
38 /* { dg-final { scan-assembler-times ".extern .func dcl_rvc2 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
39 vc2 dcl_rvc2 (void);
40 /* { dg-final { scan-assembler-times ".extern .func dcl_rvc4 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
41 vc4 dcl_rvc4 (void);
42 /* { dg-final { scan-assembler-times ".extern .func dcl_rvc8 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
43 vc8 dcl_rvc8 (void);
45 /* { dg-final { scan-assembler-times ".extern .func dcl_rvs1 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
46 vs1 dcl_rvs1 (void);
47 /* { dg-final { scan-assembler-times ".extern .func dcl_rvs2 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
48 vs2 dcl_rvs2 (void);
49 /* { dg-final { scan-assembler-times ".extern .func dcl_rvs4 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
50 vs4 dcl_rvs4 (void);
51 /* { dg-final { scan-assembler-times ".extern .func dcl_rvs8 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
52 vs8 dcl_rvs8 (void);
54 /* { dg-final { scan-assembler-times ".extern .func dcl_rvi1 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
55 vi1 dcl_rvi1 (void);
56 /* { dg-final { scan-assembler-times ".extern .func dcl_rvi2 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
57 vi2 dcl_rvi2 (void);
58 /* { dg-final { scan-assembler-times ".extern .func dcl_rvi4 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
59 vi4 dcl_rvi4 (void);
60 /* { dg-final { scan-assembler-times ".extern .func dcl_rvi8 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
61 vi8 dcl_rvi8 (void);
63 /* { dg-final { scan-assembler-times ".extern .func dcl_rvll1 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
64 vll1 dcl_rvll1 (void);
65 /* { dg-final { scan-assembler-times ".extern .func dcl_rvll2 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
66 vll2 dcl_rvll2 (void);
67 /* { dg-final { scan-assembler-times ".extern .func dcl_rvll4 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
68 vll4 dcl_rvll4 (void);
69 /* { dg-final { scan-assembler-times ".extern .func dcl_rvll8 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
70 vll8 dcl_rvll8 (void);
72 /* { dg-final { scan-assembler-times ".extern .func dcl_rvf1 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
73 vf1 dcl_rvf1 (void);
74 /* { dg-final { scan-assembler-times ".extern .func dcl_rvf2 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
75 vf2 dcl_rvf2 (void);
76 /* { dg-final { scan-assembler-times ".extern .func dcl_rvf4 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
77 vf4 dcl_rvf4 (void);
78 /* { dg-final { scan-assembler-times ".extern .func dcl_rvf8 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
79 vf8 dcl_rvf8 (void);
81 /* { dg-final { scan-assembler-times ".extern .func dcl_rvd1 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
82 vd1 dcl_rvd1 (void);
83 /* { dg-final { scan-assembler-times ".extern .func dcl_rvd2 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
84 vd2 dcl_rvd2 (void);
85 /* { dg-final { scan-assembler-times ".extern .func dcl_rvd4 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
86 vd4 dcl_rvd4 (void);
87 /* { dg-final { scan-assembler-times ".extern .func dcl_rvd8 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
88 vd8 dcl_rvd8 (void);
90 void test_1 (void)
92 dcl_rvc1 ();
93 dcl_rvc2 ();
94 dcl_rvc4 ();
95 dcl_rvc8 ();
97 dcl_rvs1 ();
98 dcl_rvs2 ();
99 dcl_rvs4 ();
100 dcl_rvs8 ();
102 dcl_rvi1 ();
103 dcl_rvi2 ();
104 dcl_rvi4 ();
105 dcl_rvi8 ();
107 dcl_rvll1 ();
108 dcl_rvll2 ();
109 dcl_rvll4 ();
110 dcl_rvll8 ();
112 dcl_rvf1 ();
113 dcl_rvf2 ();
114 dcl_rvf4 ();
115 dcl_rvf8 ();
117 dcl_rvd1 ();
118 dcl_rvd2 ();
119 dcl_rvd4 ();
120 dcl_rvd8 ();
123 #define M(T, V) ({T t;t[0]= V;t;})
125 /* { dg-final { scan-assembler-times ".visible .func dfn_rvc1 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
126 vc1 dfn_rvc1 (void)
128 return M (vc1, 1);
130 /* { dg-final { scan-assembler-times ".visible .func dfn_rvc2 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
131 vc2 dfn_rvc2 (void)
133 return M (vc2, 2);
135 /* { dg-final { scan-assembler-times ".visible .func dfn_rvc4 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
136 vc4 dfn_rvc4 (void)
138 return M (vc4, 3);
140 /* { dg-final { scan-assembler-times ".visible .func dfn_rvc8 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
141 vc8 dfn_rvc8 (void)
143 return M (vc8, 4);
146 /* { dg-final { scan-assembler-times ".visible .func dfn_rvs1 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
147 vs1 dfn_rvs1 (void)
149 return M (vs1, 5);
151 /* { dg-final { scan-assembler-times ".visible .func dfn_rvs2 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
152 vs2 dfn_rvs2 (void)
154 return M (vs2, 6);
156 /* { dg-final { scan-assembler-times ".visible .func dfn_rvs4 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
157 vs4 dfn_rvs4 (void)
159 return M (vs4, 7);
161 /* { dg-final { scan-assembler-times ".visible .func dfn_rvs8 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
162 vs8 dfn_rvs8 (void)
164 return M (vs8, 8);
167 /* { dg-final { scan-assembler-times ".visible .func dfn_rvi1 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
168 vi1 dfn_rvi1 (void)
170 return M (vi1, 9);
172 /* { dg-final { scan-assembler-times ".visible .func dfn_rvi2 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
173 vi2 dfn_rvi2 (void)
175 return M (vi2, 10);
177 /* { dg-final { scan-assembler-times ".visible .func dfn_rvi4 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
178 vi4 dfn_rvi4 (void)
180 return M (vi4, 11);
182 /* { dg-final { scan-assembler-times ".visible .func dfn_rvi8 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
183 vi8 dfn_rvi8 (void)
185 return M (vi8, 12);
188 /* { dg-final { scan-assembler-times ".visible .func dfn_rvll1 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
189 vll1 dfn_rvll1 (void)
191 return M (vll1, 13);
193 /* { dg-final { scan-assembler-times ".visible .func dfn_rvll2 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
194 vll2 dfn_rvll2 (void)
196 return M (vll2, 14);
198 /* { dg-final { scan-assembler-times ".visible .func dfn_rvll4 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
199 vll4 dfn_rvll4 (void)
201 return M (vll4, 16);
203 /* { dg-final { scan-assembler-times ".visible .func dfn_rvll8 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
204 vll8 dfn_rvll8 (void)
206 return M (vll8, 6);
209 /* { dg-final { scan-assembler-times ".visible .func dfn_rvf1 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
210 vf1 dfn_rvf1 (void)
212 return M (vf1, 17);
214 /* { dg-final { scan-assembler-times ".visible .func dfn_rvf2 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
215 vf2 dfn_rvf2 (void)
217 return M (vf2, 18);
219 /* { dg-final { scan-assembler-times ".visible .func dfn_rvf4 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
220 vf4 dfn_rvf4 (void)
222 return M (vf4, 19);
224 /* { dg-final { scan-assembler-times ".visible .func dfn_rvf8 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
225 vf8 dfn_rvf8 (void)
227 return M (vf8, 20);
230 /* { dg-final { scan-assembler-times ".visible .func dfn_rvd1 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
231 vd1 dfn_rvd1 (void)
233 return M (vd1, 21);
235 /* { dg-final { scan-assembler-times ".visible .func dfn_rvd2 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
236 vd2 dfn_rvd2 (void)
238 return M (vd2, 22);
240 /* { dg-final { scan-assembler-times ".visible .func dfn_rvd4 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
241 vd4 dfn_rvd4 (void)
243 return M (vd4, 23);
245 /* { dg-final { scan-assembler-times ".visible .func dfn_rvd8 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
246 vd8 dfn_rvd8 (void)
248 return M (vd8, 24);