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-arith-overflow.c */
26 #define create_code create_code_arith_overflow
27 #define verify_code verify_code_arith_overflow
28 #include "test-arith-overflow.c"
32 /* test-array-as-pointer.c */
33 #define create_code create_code_array_as_pointer
34 #define verify_code verify_code_array_as_pointer
35 #include "test-array-as-pointer.c"
40 #define create_code create_code_arrays
41 #define verify_code verify_code_arrays
42 #include "test-arrays.c"
46 /* test-calling-external-function.c */
47 #define create_code create_code_calling_external_function
48 #define verify_code verify_code_calling_external_function
49 #include "test-calling-external-function.c"
53 /* test-calling-function-ptr.c */
54 #define create_code create_code_calling_function_ptr
55 #define verify_code verify_code_calling_function_ptr
56 #include "test-calling-function-ptr.c"
60 /* test-compound-assignment.c */
61 #define create_code create_code_compound_assignment
62 #define verify_code verify_code_compound_assignment
63 #include "test-compound-assignment.c"
67 /* test-constants.c */
68 #define create_code create_code_constants
69 #define verify_code verify_code_constants
70 #include "test-constants.c"
74 /* test-debug-strings.c */
75 #define create_code create_code_debug_strings
76 #define verify_code verify_code_debug_strings
77 #include "test-debug-strings.c"
81 /* test-dot-product.c */
82 #define create_code create_code_dot_product
83 #define verify_code verify_code_dot_product
84 #include "test-dot-product.c"
88 /* test-error-*.c: We don't use these test cases, since they deliberately
89 introduce errors, which we don't want here. */
91 /* test-expressions.c */
92 #define create_code create_code_expressions
93 #define verify_code verify_code_expressions
94 #include "test-expressions.c"
98 /* test-extra-options.c: We don't use this one, since the extra options
99 affect the whole context. */
101 /* test-factorial.c */
102 #define create_code create_code_factorial
103 #define verify_code verify_code_factorial
104 #include "test-factorial.c"
108 /* test-fibonacci.c */
109 #define create_code create_code_fibonacci
110 #define verify_code verify_code_fibonacci
111 #include "test-fibonacci.c"
115 /* test-functions.c */
116 #define create_code create_code_functions
117 #define verify_code verify_code_functions
118 #include "test-functions.c"
122 /* test-hello-world.c */
123 #define create_code create_code_hello_world
124 #define verify_code verify_code_hello_world
125 #include "test-hello-world.c"
129 /* test-linked-list.c */
130 #define create_code create_code_linked_list
131 #define verify_code verify_code_linked_list
132 #include "test-linked-list.c"
136 /* test-long-names.c */
137 #define create_code create_code_long_names
138 #define verify_code verify_code_long_names
139 #include "test-long-names.c"
143 /* test-quadratic.c */
144 #define create_code create_code_quadratic
145 #define verify_code verify_code_quadratic
146 #include "test-quadratic.c"
150 /* test-nested-loops.c */
151 #define create_code create_code_nested_loop
152 #define verify_code verify_code_nested_loop
153 #include "test-nested-loops.c"
157 /* test-pr66700-observing-write-through-ptr.c */
158 #define create_code create_code_pr66700_observing_write_through_ptr
159 #define verify_code verify_code_pr66700_observing_write_through_ptr
160 #include "test-pr66700-observing-write-through-ptr.c"
164 /* test-reading-struct.c */
165 #define create_code create_code_reading_struct
166 #define verify_code verify_code_reading_struct
167 #include "test-reading-struct.c"
171 /* test-string-literal.c */
172 #define create_code create_code_string_literal
173 #define verify_code verify_code_string_literal
174 #include "test-string-literal.c"
178 /* test-sum-of-squares.c */
179 #define create_code create_code_sum_of_squares
180 #define verify_code verify_code_sum_of_squares
181 #include "test-sum-of-squares.c"
186 #define create_code create_code_switch
187 #define verify_code verify_code_switch
188 #include "test-switch.c"
193 #define create_code create_code_types
194 #define verify_code verify_code_types
195 #include "test-types.c"
199 /* test-using-global.c */
200 #define create_code create_code_using_global
201 #define verify_code verify_code_using_global
202 #include "test-using-global.c"
206 /* test-validly-unreachable-block.c: We don't use this one, since the use
207 of gcc_jit_context_set_bool_allow_unreachable_blocks affects the whole
210 /* test-volatile.c */
211 #define create_code create_code_volatile
212 #define verify_code verify_code_volatile
213 #include "test-volatile.c"
217 /* Now expose the individual testcases as instances of this struct. */
222 void (*m_hook_to_create_code
) (gcc_jit_context
*ctxt
,
224 void (*m_hook_to_verify_code
) (gcc_jit_context
*ctxt
,
225 gcc_jit_result
*result
);
228 const struct testcase testcases
[] = {
230 create_code_accessing_struct
,
231 verify_code_accessing_struct
},
233 create_code_accessing_union
,
234 verify_code_accessing_union
},
236 create_code_arith_overflow
,
237 verify_code_arith_overflow
},
239 create_code_array_as_pointer
,
240 verify_code_array_as_pointer
},
244 {"calling_external_function",
245 create_code_calling_external_function
,
246 verify_code_calling_external_function
},
247 {"calling_function_ptr",
248 create_code_calling_function_ptr
,
249 verify_code_calling_function_ptr
},
250 {"compound_assignment",
251 create_code_compound_assignment
,
252 verify_code_compound_assignment
},
254 create_code_constants
,
255 verify_code_constants
},
257 create_code_debug_strings
,
258 verify_code_debug_strings
},
260 create_code_dot_product
,
261 verify_code_dot_product
},
263 create_code_expressions
,
264 verify_code_expressions
},
266 create_code_factorial
,
267 verify_code_factorial
},
269 create_code_fibonacci
,
270 verify_code_fibonacci
},
272 create_code_functions
,
273 verify_code_functions
},
275 create_code_hello_world
,
276 verify_code_hello_world
},
278 create_code_linked_list
,
279 verify_code_linked_list
},
281 create_code_long_names
,
282 verify_code_long_names
},
284 create_code_quadratic
,
285 verify_code_quadratic
},
287 create_code_nested_loop
,
288 verify_code_nested_loop
},
289 {"pr66700_observing_write_through_ptr",
290 create_code_pr66700_observing_write_through_ptr
,
291 verify_code_pr66700_observing_write_through_ptr
},
293 create_code_reading_struct
,
294 verify_code_reading_struct
},
296 create_code_string_literal
,
297 verify_code_string_literal
},
299 create_code_sum_of_squares
,
300 verify_code_sum_of_squares
},
308 create_code_using_global
,
309 verify_code_using_global
},
311 create_code_volatile
,
312 verify_code_volatile
}
315 const int num_testcases
= (sizeof (testcases
) / sizeof (testcases
[0]));