jit: fix segfault with autovectorization (PR tree-optimization/46805)
[official-gcc.git] / gcc / testsuite / jit.dg / all-non-failing-tests.h
blobacfcc404e059375e8450d25442e0d45ad178d6c5
1 /* This file is used by test-combination.c and test-threads.c to
2 bring all of the non-failing test cases into one source file,
3 renaming each "create_code" and "verify_code" hook so that they
4 each have unique name. */
6 /* Include various other test cases, defining COMBINED_TEST so that
7 harness.h doesn't duplicate copes of e.g. main, and renaming the
8 hooks provided by each test case. */
9 #define COMBINED_TEST
11 /* test-accessing-struct.c */
12 #define create_code create_code_accessing_struct
13 #define verify_code verify_code_accessing_struct
14 #include "test-accessing-struct.c"
15 #undef create_code
16 #undef verify_code
18 /* test-accessing-union.c */
19 #define create_code create_code_accessing_union
20 #define verify_code verify_code_accessing_union
21 #include "test-accessing-union.c"
22 #undef create_code
23 #undef verify_code
25 /* test-alignment.c */
26 #define create_code create_code_alignment
27 #define verify_code verify_code_alignment
28 #include "test-alignment.c"
29 #undef create_code
30 #undef verify_code
32 /* test-arith-overflow.c */
33 #define create_code create_code_arith_overflow
34 #define verify_code verify_code_arith_overflow
35 #include "test-arith-overflow.c"
36 #undef create_code
37 #undef verify_code
39 /* test-array-as-pointer.c */
40 #define create_code create_code_array_as_pointer
41 #define verify_code verify_code_array_as_pointer
42 #include "test-array-as-pointer.c"
43 #undef create_code
44 #undef verify_code
46 /* test-arrays.c */
47 #define create_code create_code_arrays
48 #define verify_code verify_code_arrays
49 #include "test-arrays.c"
50 #undef create_code
51 #undef verify_code
53 /* test-autovectorize.c */
54 #define create_code create_code_autovectorize
55 #define verify_code verify_code_autovectorize
56 #include "test-autovectorize.c"
57 #undef create_code
58 #undef verify_code
60 /* test-calling-external-function.c */
61 #define create_code create_code_calling_external_function
62 #define verify_code verify_code_calling_external_function
63 #include "test-calling-external-function.c"
64 #undef create_code
65 #undef verify_code
67 /* test-calling-function-ptr.c */
68 #define create_code create_code_calling_function_ptr
69 #define verify_code verify_code_calling_function_ptr
70 #include "test-calling-function-ptr.c"
71 #undef create_code
72 #undef verify_code
74 /* test-compound-assignment.c */
75 #define create_code create_code_compound_assignment
76 #define verify_code verify_code_compound_assignment
77 #include "test-compound-assignment.c"
78 #undef create_code
79 #undef verify_code
81 /* test-constants.c */
82 #define create_code create_code_constants
83 #define verify_code verify_code_constants
84 #include "test-constants.c"
85 #undef create_code
86 #undef verify_code
88 /* test-debug-strings.c */
89 #define create_code create_code_debug_strings
90 #define verify_code verify_code_debug_strings
91 #include "test-debug-strings.c"
92 #undef create_code
93 #undef verify_code
95 /* test-dot-product.c */
96 #define create_code create_code_dot_product
97 #define verify_code verify_code_dot_product
98 #include "test-dot-product.c"
99 #undef create_code
100 #undef verify_code
102 /* test-error-*.c: We don't use these test cases, since they deliberately
103 introduce errors, which we don't want here. */
105 /* test-expressions.c */
106 #define create_code create_code_expressions
107 #define verify_code verify_code_expressions
108 #include "test-expressions.c"
109 #undef create_code
110 #undef verify_code
112 /* test-extra-options.c: We don't use this one, since the extra options
113 affect the whole context. */
115 /* test-factorial.c */
116 #define create_code create_code_factorial
117 #define verify_code verify_code_factorial
118 #include "test-factorial.c"
119 #undef create_code
120 #undef verify_code
122 /* test-factorial-must-tail-call.c */
123 #define create_code create_code_factorial_must_tail_call
124 #define verify_code verify_code_factorial_must_tail_call
125 #include "test-factorial-must-tail-call.c"
126 #undef create_code
127 #undef verify_code
129 /* test-fibonacci.c */
130 #define create_code create_code_fibonacci
131 #define verify_code verify_code_fibonacci
132 #include "test-fibonacci.c"
133 #undef create_code
134 #undef verify_code
136 /* test-functions.c */
137 #define create_code create_code_functions
138 #define verify_code verify_code_functions
139 #include "test-functions.c"
140 #undef create_code
141 #undef verify_code
143 /* test-hello-world.c */
144 #define create_code create_code_hello_world
145 #define verify_code verify_code_hello_world
146 #include "test-hello-world.c"
147 #undef create_code
148 #undef verify_code
150 /* test-linked-list.c */
151 #define create_code create_code_linked_list
152 #define verify_code verify_code_linked_list
153 #include "test-linked-list.c"
154 #undef create_code
155 #undef verify_code
157 /* test-long-names.c */
158 #define create_code create_code_long_names
159 #define verify_code verify_code_long_names
160 #include "test-long-names.c"
161 #undef create_code
162 #undef verify_code
164 /* test-quadratic.c */
165 #define create_code create_code_quadratic
166 #define verify_code verify_code_quadratic
167 #include "test-quadratic.c"
168 #undef create_code
169 #undef verify_code
171 /* test-nested-loops.c */
172 #define create_code create_code_nested_loop
173 #define verify_code verify_code_nested_loop
174 #include "test-nested-loops.c"
175 #undef create_code
176 #undef verify_code
178 /* test-pr66700-observing-write-through-ptr.c */
179 #define create_code create_code_pr66700_observing_write_through_ptr
180 #define verify_code verify_code_pr66700_observing_write_through_ptr
181 #include "test-pr66700-observing-write-through-ptr.c"
182 #undef create_code
183 #undef verify_code
185 /* test-pr66779.c */
186 #define create_code create_code_pr66779
187 #define verify_code verify_code_pr66779
188 #include "test-pr66779.c"
189 #undef create_code
190 #undef verify_code
192 /* test-reading-struct.c */
193 #define create_code create_code_reading_struct
194 #define verify_code verify_code_reading_struct
195 #include "test-reading-struct.c"
196 #undef create_code
197 #undef verify_code
199 /* test-string-literal.c */
200 #define create_code create_code_string_literal
201 #define verify_code verify_code_string_literal
202 #include "test-string-literal.c"
203 #undef create_code
204 #undef verify_code
206 /* test-sum-of-squares.c */
207 #define create_code create_code_sum_of_squares
208 #define verify_code verify_code_sum_of_squares
209 #include "test-sum-of-squares.c"
210 #undef create_code
211 #undef verify_code
213 /* test-switch.c */
214 #define create_code create_code_switch
215 #define verify_code verify_code_switch
216 #include "test-switch.c"
217 #undef create_code
218 #undef verify_code
220 /* test-types.c */
221 #define create_code create_code_types
222 #define verify_code verify_code_types
223 #include "test-types.c"
224 #undef create_code
225 #undef verify_code
227 /* test-using-global.c */
228 #define create_code create_code_using_global
229 #define verify_code verify_code_using_global
230 #include "test-using-global.c"
231 #undef create_code
232 #undef verify_code
234 /* test-validly-unreachable-block.c: We don't use this one, since the use
235 of gcc_jit_context_set_bool_allow_unreachable_blocks affects the whole
236 context. */
238 /* test-vector-types.cc: We don't use this, since it's C++. */
240 /* test-volatile.c */
241 #define create_code create_code_volatile
242 #define verify_code verify_code_volatile
243 #include "test-volatile.c"
244 #undef create_code
245 #undef verify_code
247 /* Now expose the individual testcases as instances of this struct. */
249 struct testcase
251 const char *m_name;
252 void (*m_hook_to_create_code) (gcc_jit_context *ctxt,
253 void * user_data);
254 void (*m_hook_to_verify_code) (gcc_jit_context *ctxt,
255 gcc_jit_result *result);
258 const struct testcase testcases[] = {
259 {"accessing_struct",
260 create_code_accessing_struct,
261 verify_code_accessing_struct},
262 {"accessing_union",
263 create_code_accessing_union,
264 verify_code_accessing_union},
265 {"alignment",
266 create_code_alignment,
267 verify_code_alignment},
268 {"arith_overflow",
269 create_code_arith_overflow,
270 verify_code_arith_overflow},
271 {"array_as_pointer",
272 create_code_array_as_pointer,
273 verify_code_array_as_pointer},
274 {"arrays",
275 create_code_arrays,
276 verify_code_arrays},
277 {"autovectorize",
278 create_code_autovectorize,
279 verify_code_autovectorize},
280 {"calling_external_function",
281 create_code_calling_external_function,
282 verify_code_calling_external_function},
283 {"calling_function_ptr",
284 create_code_calling_function_ptr,
285 verify_code_calling_function_ptr},
286 {"compound_assignment",
287 create_code_compound_assignment,
288 verify_code_compound_assignment},
289 {"constants",
290 create_code_constants,
291 verify_code_constants},
292 {"debug_strings",
293 create_code_debug_strings,
294 verify_code_debug_strings},
295 {"dot_product",
296 create_code_dot_product,
297 verify_code_dot_product},
298 {"expressions",
299 create_code_expressions,
300 verify_code_expressions},
301 {"factorial",
302 create_code_factorial,
303 verify_code_factorial},
304 {"factorial_must_tail_call",
305 create_code_factorial_must_tail_call,
306 verify_code_factorial_must_tail_call},
307 {"fibonacci",
308 create_code_fibonacci,
309 verify_code_fibonacci},
310 {"functions",
311 create_code_functions,
312 verify_code_functions},
313 {"hello_world",
314 create_code_hello_world,
315 verify_code_hello_world},
316 {"linked_list",
317 create_code_linked_list,
318 verify_code_linked_list},
319 {"long_names",
320 create_code_long_names,
321 verify_code_long_names},
322 {"quadratic",
323 create_code_quadratic,
324 verify_code_quadratic},
325 {"nested_loop",
326 create_code_nested_loop,
327 verify_code_nested_loop},
328 {"pr66700_observing_write_through_ptr",
329 create_code_pr66700_observing_write_through_ptr,
330 verify_code_pr66700_observing_write_through_ptr},
331 {"pr66779",
332 create_code_pr66779,
333 verify_code_pr66779},
334 {"reading_struct ",
335 create_code_reading_struct ,
336 verify_code_reading_struct },
337 {"string_literal",
338 create_code_string_literal,
339 verify_code_string_literal},
340 {"sum_of_squares",
341 create_code_sum_of_squares,
342 verify_code_sum_of_squares},
343 {"switch",
344 create_code_switch,
345 verify_code_switch},
346 {"types",
347 create_code_types,
348 verify_code_types},
349 {"using_global",
350 create_code_using_global,
351 verify_code_using_global},
352 {"volatile",
353 create_code_volatile,
354 verify_code_volatile}
357 const int num_testcases = (sizeof (testcases) / sizeof (testcases[0]));