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-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"
81 /* test-constants.c */
82 #define create_code create_code_constants
83 #define verify_code verify_code_constants
84 #include "test-constants.c"
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"
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"
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"
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"
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"
129 /* test-fibonacci.c */
130 #define create_code create_code_fibonacci
131 #define verify_code verify_code_fibonacci
132 #include "test-fibonacci.c"
136 /* test-functions.c */
137 #define create_code create_code_functions
138 #define verify_code verify_code_functions
139 #include "test-functions.c"
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"
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"
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"
164 /* test-quadratic.c */
165 #define create_code create_code_quadratic
166 #define verify_code verify_code_quadratic
167 #include "test-quadratic.c"
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"
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"
186 #define create_code create_code_pr66779
187 #define verify_code verify_code_pr66779
188 #include "test-pr66779.c"
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"
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"
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"
214 #define create_code create_code_switch
215 #define verify_code verify_code_switch
216 #include "test-switch.c"
221 #define create_code create_code_types
222 #define verify_code verify_code_types
223 #include "test-types.c"
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"
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
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"
247 /* Now expose the individual testcases as instances of this struct. */
252 void (*m_hook_to_create_code
) (gcc_jit_context
*ctxt
,
254 void (*m_hook_to_verify_code
) (gcc_jit_context
*ctxt
,
255 gcc_jit_result
*result
);
258 const struct testcase testcases
[] = {
260 create_code_accessing_struct
,
261 verify_code_accessing_struct
},
263 create_code_accessing_union
,
264 verify_code_accessing_union
},
266 create_code_alignment
,
267 verify_code_alignment
},
269 create_code_arith_overflow
,
270 verify_code_arith_overflow
},
272 create_code_array_as_pointer
,
273 verify_code_array_as_pointer
},
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
},
290 create_code_constants
,
291 verify_code_constants
},
293 create_code_debug_strings
,
294 verify_code_debug_strings
},
296 create_code_dot_product
,
297 verify_code_dot_product
},
299 create_code_expressions
,
300 verify_code_expressions
},
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
},
308 create_code_fibonacci
,
309 verify_code_fibonacci
},
311 create_code_functions
,
312 verify_code_functions
},
314 create_code_hello_world
,
315 verify_code_hello_world
},
317 create_code_linked_list
,
318 verify_code_linked_list
},
320 create_code_long_names
,
321 verify_code_long_names
},
323 create_code_quadratic
,
324 verify_code_quadratic
},
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
},
333 verify_code_pr66779
},
335 create_code_reading_struct
,
336 verify_code_reading_struct
},
338 create_code_string_literal
,
339 verify_code_string_literal
},
341 create_code_sum_of_squares
,
342 verify_code_sum_of_squares
},
350 create_code_using_global
,
351 verify_code_using_global
},
353 create_code_volatile
,
354 verify_code_volatile
}
357 const int num_testcases
= (sizeof (testcases
) / sizeof (testcases
[0]));