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. */
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"
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"
25 /* test-alignment.c */
26 #define create_code create_code_alignment
27 #define verify_code verify_code_alignment
28 #include "test-alignment.c"
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"
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"
47 #define create_code create_code_arrays
48 #define verify_code verify_code_arrays
49 #include "test-arrays.c"
53 /* test-autovectorize.c */
54 #define create_code create_code_autovectorize
55 #define verify_code verify_code_autovectorize
56 #include "test-autovectorize.c"
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"
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"
74 /* test-returning-function-ptr.c */
75 #define create_code create_code_calling_internal_function
76 #define verify_code verify_code_calling_internal_function
77 #include "test-returning-function-ptr.c"
81 /* test-compound-assignment.c */
82 #define create_code create_code_compound_assignment
83 #define verify_code verify_code_compound_assignment
84 #include "test-compound-assignment.c"
88 /* test-constants.c */
89 #define create_code create_code_constants
90 #define verify_code verify_code_constants
91 #include "test-constants.c"
95 /* test-debug-strings.c */
96 #define create_code create_code_debug_strings
97 #define verify_code verify_code_debug_strings
98 #include "test-debug-strings.c"
102 /* test-dot-product.c */
103 #define create_code create_code_dot_product
104 #define verify_code verify_code_dot_product
105 #include "test-dot-product.c"
109 /* test-error-*.c: We don't use these test cases, since they deliberately
110 introduce errors, which we don't want here. */
112 /* test-expressions.c */
113 #define create_code create_code_expressions
114 #define verify_code verify_code_expressions
115 #include "test-expressions.c"
119 /* test-extra-options.c: We don't use this one, since the extra options
120 affect the whole context. */
122 /* test-factorial.c */
123 #define create_code create_code_factorial
124 #define verify_code verify_code_factorial
125 #include "test-factorial.c"
129 /* test-factorial-must-tail-call.c */
130 #define create_code create_code_factorial_must_tail_call
131 #define verify_code verify_code_factorial_must_tail_call
132 #include "test-factorial-must-tail-call.c"
136 /* test-fibonacci.c */
137 #define create_code create_code_fibonacci
138 #define verify_code verify_code_fibonacci
139 #include "test-fibonacci.c"
143 /* test-functions.c */
144 #define create_code create_code_functions
145 #define verify_code verify_code_functions
146 #include "test-functions.c"
150 /* test-hello-world.c */
151 #define create_code create_code_hello_world
152 #define verify_code verify_code_hello_world
153 #include "test-hello-world.c"
157 /* test-linked-list.c */
158 #define create_code create_code_linked_list
159 #define verify_code verify_code_linked_list
160 #include "test-linked-list.c"
164 /* test-long-names.c */
165 #define create_code create_code_long_names
166 #define verify_code verify_code_long_names
167 #include "test-long-names.c"
171 /* test-quadratic.c */
172 #define create_code create_code_quadratic
173 #define verify_code verify_code_quadratic
174 #include "test-quadratic.c"
178 /* test-nested-loops.c */
179 #define create_code create_code_nested_loop
180 #define verify_code verify_code_nested_loop
181 #include "test-nested-loops.c"
185 /* test-pr66700-observing-write-through-ptr.c */
186 #define create_code create_code_pr66700_observing_write_through_ptr
187 #define verify_code verify_code_pr66700_observing_write_through_ptr
188 #include "test-pr66700-observing-write-through-ptr.c"
193 #define create_code create_code_pr66779
194 #define verify_code verify_code_pr66779
195 #include "test-pr66779.c"
199 /* test-reading-struct.c */
200 #define create_code create_code_reading_struct
201 #define verify_code verify_code_reading_struct
202 #include "test-reading-struct.c"
206 /* test-string-literal.c */
207 #define create_code create_code_string_literal
208 #define verify_code verify_code_string_literal
209 #include "test-string-literal.c"
213 /* test-sum-of-squares.c */
214 #define create_code create_code_sum_of_squares
215 #define verify_code verify_code_sum_of_squares
216 #include "test-sum-of-squares.c"
221 #define create_code create_code_switch
222 #define verify_code verify_code_switch
223 #include "test-switch.c"
228 #define create_code create_code_types
229 #define verify_code verify_code_types
230 #include "test-types.c"
234 /* test-using-global.c */
235 #define create_code create_code_using_global
236 #define verify_code verify_code_using_global
237 #include "test-using-global.c"
241 /* test-validly-unreachable-block.c: We don't use this one, since the use
242 of gcc_jit_context_set_bool_allow_unreachable_blocks affects the whole
245 /* test-vector-types.cc: We don't use this, since it's C++. */
247 /* test-volatile.c */
248 #define create_code create_code_volatile
249 #define verify_code verify_code_volatile
250 #include "test-volatile.c"
254 /* Now expose the individual testcases as instances of this struct. */
259 void (*m_hook_to_create_code
) (gcc_jit_context
*ctxt
,
261 void (*m_hook_to_verify_code
) (gcc_jit_context
*ctxt
,
262 gcc_jit_result
*result
);
265 const struct testcase testcases
[] = {
267 create_code_accessing_struct
,
268 verify_code_accessing_struct
},
270 create_code_accessing_union
,
271 verify_code_accessing_union
},
273 create_code_alignment
,
274 verify_code_alignment
},
276 create_code_arith_overflow
,
277 verify_code_arith_overflow
},
279 create_code_array_as_pointer
,
280 verify_code_array_as_pointer
},
285 create_code_autovectorize
,
286 verify_code_autovectorize
},
287 {"calling_external_function",
288 create_code_calling_external_function
,
289 verify_code_calling_external_function
},
290 {"calling_function_ptr",
291 create_code_calling_function_ptr
,
292 verify_code_calling_function_ptr
},
293 {"calling_internal_function",
294 create_code_calling_internal_function
,
295 verify_code_calling_internal_function
},
296 {"compound_assignment",
297 create_code_compound_assignment
,
298 verify_code_compound_assignment
},
300 create_code_constants
,
301 verify_code_constants
},
303 create_code_debug_strings
,
304 verify_code_debug_strings
},
306 create_code_dot_product
,
307 verify_code_dot_product
},
309 create_code_expressions
,
310 verify_code_expressions
},
312 create_code_factorial
,
313 verify_code_factorial
},
314 {"factorial_must_tail_call",
315 create_code_factorial_must_tail_call
,
316 verify_code_factorial_must_tail_call
},
318 create_code_fibonacci
,
319 verify_code_fibonacci
},
321 create_code_functions
,
322 verify_code_functions
},
324 create_code_hello_world
,
325 verify_code_hello_world
},
327 create_code_linked_list
,
328 verify_code_linked_list
},
330 create_code_long_names
,
331 verify_code_long_names
},
333 create_code_quadratic
,
334 verify_code_quadratic
},
336 create_code_nested_loop
,
337 verify_code_nested_loop
},
338 {"pr66700_observing_write_through_ptr",
339 create_code_pr66700_observing_write_through_ptr
,
340 verify_code_pr66700_observing_write_through_ptr
},
343 verify_code_pr66779
},
345 create_code_reading_struct
,
346 verify_code_reading_struct
},
348 create_code_string_literal
,
349 verify_code_string_literal
},
351 create_code_sum_of_squares
,
352 verify_code_sum_of_squares
},
360 create_code_using_global
,
361 verify_code_using_global
},
363 create_code_volatile
,
364 verify_code_volatile
}
367 const int num_testcases
= (sizeof (testcases
) / sizeof (testcases
[0]));