2016-12-21 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / jit.dg / all-non-failing-tests.h
blob3e2b3b910fc468f76339b157e469ab59241af7ec
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-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"
29 #undef create_code
30 #undef verify_code
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"
36 #undef create_code
37 #undef verify_code
39 /* test-arrays.c */
40 #define create_code create_code_arrays
41 #define verify_code verify_code_arrays
42 #include "test-arrays.c"
43 #undef create_code
44 #undef verify_code
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"
50 #undef create_code
51 #undef verify_code
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"
57 #undef create_code
58 #undef verify_code
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"
64 #undef create_code
65 #undef verify_code
67 /* test-constants.c */
68 #define create_code create_code_constants
69 #define verify_code verify_code_constants
70 #include "test-constants.c"
71 #undef create_code
72 #undef verify_code
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"
78 #undef create_code
79 #undef verify_code
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"
85 #undef create_code
86 #undef verify_code
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"
95 #undef create_code
96 #undef verify_code
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"
105 #undef create_code
106 #undef verify_code
108 /* test-factorial-must-tail-call.c */
109 #define create_code create_code_factorial_must_tail_call
110 #define verify_code verify_code_factorial_must_tail_call
111 #include "test-factorial-must-tail-call.c"
112 #undef create_code
113 #undef verify_code
115 /* test-fibonacci.c */
116 #define create_code create_code_fibonacci
117 #define verify_code verify_code_fibonacci
118 #include "test-fibonacci.c"
119 #undef create_code
120 #undef verify_code
122 /* test-functions.c */
123 #define create_code create_code_functions
124 #define verify_code verify_code_functions
125 #include "test-functions.c"
126 #undef create_code
127 #undef verify_code
129 /* test-hello-world.c */
130 #define create_code create_code_hello_world
131 #define verify_code verify_code_hello_world
132 #include "test-hello-world.c"
133 #undef create_code
134 #undef verify_code
136 /* test-linked-list.c */
137 #define create_code create_code_linked_list
138 #define verify_code verify_code_linked_list
139 #include "test-linked-list.c"
140 #undef create_code
141 #undef verify_code
143 /* test-long-names.c */
144 #define create_code create_code_long_names
145 #define verify_code verify_code_long_names
146 #include "test-long-names.c"
147 #undef create_code
148 #undef verify_code
150 /* test-quadratic.c */
151 #define create_code create_code_quadratic
152 #define verify_code verify_code_quadratic
153 #include "test-quadratic.c"
154 #undef create_code
155 #undef verify_code
157 /* test-nested-loops.c */
158 #define create_code create_code_nested_loop
159 #define verify_code verify_code_nested_loop
160 #include "test-nested-loops.c"
161 #undef create_code
162 #undef verify_code
164 /* test-pr66700-observing-write-through-ptr.c */
165 #define create_code create_code_pr66700_observing_write_through_ptr
166 #define verify_code verify_code_pr66700_observing_write_through_ptr
167 #include "test-pr66700-observing-write-through-ptr.c"
168 #undef create_code
169 #undef verify_code
171 /* test-pr66779.c */
172 #define create_code create_code_pr66779
173 #define verify_code verify_code_pr66779
174 #include "test-pr66779.c"
175 #undef create_code
176 #undef verify_code
178 /* test-reading-struct.c */
179 #define create_code create_code_reading_struct
180 #define verify_code verify_code_reading_struct
181 #include "test-reading-struct.c"
182 #undef create_code
183 #undef verify_code
185 /* test-string-literal.c */
186 #define create_code create_code_string_literal
187 #define verify_code verify_code_string_literal
188 #include "test-string-literal.c"
189 #undef create_code
190 #undef verify_code
192 /* test-sum-of-squares.c */
193 #define create_code create_code_sum_of_squares
194 #define verify_code verify_code_sum_of_squares
195 #include "test-sum-of-squares.c"
196 #undef create_code
197 #undef verify_code
199 /* test-switch.c */
200 #define create_code create_code_switch
201 #define verify_code verify_code_switch
202 #include "test-switch.c"
203 #undef create_code
204 #undef verify_code
206 /* test-types.c */
207 #define create_code create_code_types
208 #define verify_code verify_code_types
209 #include "test-types.c"
210 #undef create_code
211 #undef verify_code
213 /* test-using-global.c */
214 #define create_code create_code_using_global
215 #define verify_code verify_code_using_global
216 #include "test-using-global.c"
217 #undef create_code
218 #undef verify_code
220 /* test-validly-unreachable-block.c: We don't use this one, since the use
221 of gcc_jit_context_set_bool_allow_unreachable_blocks affects the whole
222 context. */
224 /* test-volatile.c */
225 #define create_code create_code_volatile
226 #define verify_code verify_code_volatile
227 #include "test-volatile.c"
228 #undef create_code
229 #undef verify_code
231 /* Now expose the individual testcases as instances of this struct. */
233 struct testcase
235 const char *m_name;
236 void (*m_hook_to_create_code) (gcc_jit_context *ctxt,
237 void * user_data);
238 void (*m_hook_to_verify_code) (gcc_jit_context *ctxt,
239 gcc_jit_result *result);
242 const struct testcase testcases[] = {
243 {"accessing_struct",
244 create_code_accessing_struct,
245 verify_code_accessing_struct},
246 {"accessing_union",
247 create_code_accessing_union,
248 verify_code_accessing_union},
249 {"arith_overflow",
250 create_code_arith_overflow,
251 verify_code_arith_overflow},
252 {"array_as_pointer",
253 create_code_array_as_pointer,
254 verify_code_array_as_pointer},
255 {"arrays",
256 create_code_arrays,
257 verify_code_arrays},
258 {"calling_external_function",
259 create_code_calling_external_function,
260 verify_code_calling_external_function},
261 {"calling_function_ptr",
262 create_code_calling_function_ptr,
263 verify_code_calling_function_ptr},
264 {"compound_assignment",
265 create_code_compound_assignment,
266 verify_code_compound_assignment},
267 {"constants",
268 create_code_constants,
269 verify_code_constants},
270 {"debug_strings",
271 create_code_debug_strings,
272 verify_code_debug_strings},
273 {"dot_product",
274 create_code_dot_product,
275 verify_code_dot_product},
276 {"expressions",
277 create_code_expressions,
278 verify_code_expressions},
279 {"factorial",
280 create_code_factorial,
281 verify_code_factorial},
282 {"factorial_must_tail_call",
283 create_code_factorial_must_tail_call,
284 verify_code_factorial_must_tail_call},
285 {"fibonacci",
286 create_code_fibonacci,
287 verify_code_fibonacci},
288 {"functions",
289 create_code_functions,
290 verify_code_functions},
291 {"hello_world",
292 create_code_hello_world,
293 verify_code_hello_world},
294 {"linked_list",
295 create_code_linked_list,
296 verify_code_linked_list},
297 {"long_names",
298 create_code_long_names,
299 verify_code_long_names},
300 {"quadratic",
301 create_code_quadratic,
302 verify_code_quadratic},
303 {"nested_loop",
304 create_code_nested_loop,
305 verify_code_nested_loop},
306 {"pr66700_observing_write_through_ptr",
307 create_code_pr66700_observing_write_through_ptr,
308 verify_code_pr66700_observing_write_through_ptr},
309 {"pr66779",
310 create_code_pr66779,
311 verify_code_pr66779},
312 {"reading_struct ",
313 create_code_reading_struct ,
314 verify_code_reading_struct },
315 {"string_literal",
316 create_code_string_literal,
317 verify_code_string_literal},
318 {"sum_of_squares",
319 create_code_sum_of_squares,
320 verify_code_sum_of_squares},
321 {"switch",
322 create_code_switch,
323 verify_code_switch},
324 {"types",
325 create_code_types,
326 verify_code_types},
327 {"using_global",
328 create_code_using_global,
329 verify_code_using_global},
330 {"volatile",
331 create_code_volatile,
332 verify_code_volatile}
335 const int num_testcases = (sizeof (testcases) / sizeof (testcases[0]));