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-calling-external-function.c */
54 #define create_code create_code_calling_external_function
55 #define verify_code verify_code_calling_external_function
56 #include "test-calling-external-function.c"
60 /* test-calling-function-ptr.c */
61 #define create_code create_code_calling_function_ptr
62 #define verify_code verify_code_calling_function_ptr
63 #include "test-calling-function-ptr.c"
67 /* test-compound-assignment.c */
68 #define create_code create_code_compound_assignment
69 #define verify_code verify_code_compound_assignment
70 #include "test-compound-assignment.c"
74 /* test-constants.c */
75 #define create_code create_code_constants
76 #define verify_code verify_code_constants
77 #include "test-constants.c"
81 /* test-debug-strings.c */
82 #define create_code create_code_debug_strings
83 #define verify_code verify_code_debug_strings
84 #include "test-debug-strings.c"
88 /* test-dot-product.c */
89 #define create_code create_code_dot_product
90 #define verify_code verify_code_dot_product
91 #include "test-dot-product.c"
95 /* test-error-*.c: We don't use these test cases, since they deliberately
96 introduce errors, which we don't want here. */
98 /* test-expressions.c */
99 #define create_code create_code_expressions
100 #define verify_code verify_code_expressions
101 #include "test-expressions.c"
105 /* test-extra-options.c: We don't use this one, since the extra options
106 affect the whole context. */
108 /* test-factorial.c */
109 #define create_code create_code_factorial
110 #define verify_code verify_code_factorial
111 #include "test-factorial.c"
115 /* test-factorial-must-tail-call.c */
116 #define create_code create_code_factorial_must_tail_call
117 #define verify_code verify_code_factorial_must_tail_call
118 #include "test-factorial-must-tail-call.c"
122 /* test-fibonacci.c */
123 #define create_code create_code_fibonacci
124 #define verify_code verify_code_fibonacci
125 #include "test-fibonacci.c"
129 /* test-functions.c */
130 #define create_code create_code_functions
131 #define verify_code verify_code_functions
132 #include "test-functions.c"
136 /* test-hello-world.c */
137 #define create_code create_code_hello_world
138 #define verify_code verify_code_hello_world
139 #include "test-hello-world.c"
143 /* test-linked-list.c */
144 #define create_code create_code_linked_list
145 #define verify_code verify_code_linked_list
146 #include "test-linked-list.c"
150 /* test-long-names.c */
151 #define create_code create_code_long_names
152 #define verify_code verify_code_long_names
153 #include "test-long-names.c"
157 /* test-quadratic.c */
158 #define create_code create_code_quadratic
159 #define verify_code verify_code_quadratic
160 #include "test-quadratic.c"
164 /* test-nested-loops.c */
165 #define create_code create_code_nested_loop
166 #define verify_code verify_code_nested_loop
167 #include "test-nested-loops.c"
171 /* test-pr66700-observing-write-through-ptr.c */
172 #define create_code create_code_pr66700_observing_write_through_ptr
173 #define verify_code verify_code_pr66700_observing_write_through_ptr
174 #include "test-pr66700-observing-write-through-ptr.c"
179 #define create_code create_code_pr66779
180 #define verify_code verify_code_pr66779
181 #include "test-pr66779.c"
185 /* test-reading-struct.c */
186 #define create_code create_code_reading_struct
187 #define verify_code verify_code_reading_struct
188 #include "test-reading-struct.c"
192 /* test-string-literal.c */
193 #define create_code create_code_string_literal
194 #define verify_code verify_code_string_literal
195 #include "test-string-literal.c"
199 /* test-sum-of-squares.c */
200 #define create_code create_code_sum_of_squares
201 #define verify_code verify_code_sum_of_squares
202 #include "test-sum-of-squares.c"
207 #define create_code create_code_switch
208 #define verify_code verify_code_switch
209 #include "test-switch.c"
214 #define create_code create_code_types
215 #define verify_code verify_code_types
216 #include "test-types.c"
220 /* test-using-global.c */
221 #define create_code create_code_using_global
222 #define verify_code verify_code_using_global
223 #include "test-using-global.c"
227 /* test-validly-unreachable-block.c: We don't use this one, since the use
228 of gcc_jit_context_set_bool_allow_unreachable_blocks affects the whole
231 /* test-volatile.c */
232 #define create_code create_code_volatile
233 #define verify_code verify_code_volatile
234 #include "test-volatile.c"
238 /* Now expose the individual testcases as instances of this struct. */
243 void (*m_hook_to_create_code
) (gcc_jit_context
*ctxt
,
245 void (*m_hook_to_verify_code
) (gcc_jit_context
*ctxt
,
246 gcc_jit_result
*result
);
249 const struct testcase testcases
[] = {
251 create_code_accessing_struct
,
252 verify_code_accessing_struct
},
254 create_code_accessing_union
,
255 verify_code_accessing_union
},
257 create_code_alignment
,
258 verify_code_alignment
},
260 create_code_arith_overflow
,
261 verify_code_arith_overflow
},
263 create_code_array_as_pointer
,
264 verify_code_array_as_pointer
},
268 {"calling_external_function",
269 create_code_calling_external_function
,
270 verify_code_calling_external_function
},
271 {"calling_function_ptr",
272 create_code_calling_function_ptr
,
273 verify_code_calling_function_ptr
},
274 {"compound_assignment",
275 create_code_compound_assignment
,
276 verify_code_compound_assignment
},
278 create_code_constants
,
279 verify_code_constants
},
281 create_code_debug_strings
,
282 verify_code_debug_strings
},
284 create_code_dot_product
,
285 verify_code_dot_product
},
287 create_code_expressions
,
288 verify_code_expressions
},
290 create_code_factorial
,
291 verify_code_factorial
},
292 {"factorial_must_tail_call",
293 create_code_factorial_must_tail_call
,
294 verify_code_factorial_must_tail_call
},
296 create_code_fibonacci
,
297 verify_code_fibonacci
},
299 create_code_functions
,
300 verify_code_functions
},
302 create_code_hello_world
,
303 verify_code_hello_world
},
305 create_code_linked_list
,
306 verify_code_linked_list
},
308 create_code_long_names
,
309 verify_code_long_names
},
311 create_code_quadratic
,
312 verify_code_quadratic
},
314 create_code_nested_loop
,
315 verify_code_nested_loop
},
316 {"pr66700_observing_write_through_ptr",
317 create_code_pr66700_observing_write_through_ptr
,
318 verify_code_pr66700_observing_write_through_ptr
},
321 verify_code_pr66779
},
323 create_code_reading_struct
,
324 verify_code_reading_struct
},
326 create_code_string_literal
,
327 verify_code_string_literal
},
329 create_code_sum_of_squares
,
330 verify_code_sum_of_squares
},
338 create_code_using_global
,
339 verify_code_using_global
},
341 create_code_volatile
,
342 verify_code_volatile
}
345 const int num_testcases
= (sizeof (testcases
) / sizeof (testcases
[0]));