summaryrefslogtreecommitdiff
path: root/gcc/testsuite/jit.dg/all-non-failing-tests.h
blob: 29afe064db62a706f64bb7cffdbbd1c9c4a2b5db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
/* This file is used by test-combination.c and test-threads.c to
   bring all of the non-failing test cases into one source file,
   renaming each "create_code" and "verify_code" hook so that they
   each have unique name.  */

/* Include various other test cases, defining COMBINED_TEST so that
   harness.h doesn't duplicate copes of e.g. main, and renaming the
   hooks provided by each test case.  */
#define COMBINED_TEST

/* test-accessing-bitfield.c */
#define create_code create_code_accessing_bitfield
#define verify_code verify_code_accessing_bitfield
#include "test-accessing-bitfield.c"
#undef create_code
#undef verify_code

/* test-accessing-struct.c */
#define create_code create_code_accessing_struct
#define verify_code verify_code_accessing_struct
#include "test-accessing-struct.c"
#undef create_code
#undef verify_code

/* test-accessing-union.c */
#define create_code create_code_accessing_union
#define verify_code verify_code_accessing_union
#include "test-accessing-union.c"
#undef create_code
#undef verify_code

/* test-add-driver-options.c: We don't use this one, since the extra options
   affect the whole context.  */

/* test-alignment.c */
#define create_code create_code_alignment
#define verify_code verify_code_alignment
#include "test-alignment.c"
#undef create_code
#undef verify_code

/* test-arith-overflow.c */
#define create_code create_code_arith_overflow
#define verify_code verify_code_arith_overflow
#include "test-arith-overflow.c"
#undef create_code
#undef verify_code

/* test-array-as-pointer.c */
#define create_code create_code_array_as_pointer
#define verify_code verify_code_array_as_pointer
#include "test-array-as-pointer.c"
#undef create_code
#undef verify_code

/* test-arrays.c */
#define create_code create_code_arrays
#define verify_code verify_code_arrays
#include "test-arrays.c"
#undef create_code
#undef verify_code

/* test-autovectorize.c */
#define create_code create_code_autovectorize
#define verify_code verify_code_autovectorize
#include "test-autovectorize.c"
#undef create_code
#undef verify_code

/* test-builtin-memcpy.c */
#define create_code create_code_builtin_memcpy
#define verify_code verify_code_builtin_memcpy
#include "test-builtin-memcpy.c"
#undef create_code
#undef verify_code

/* test-builtin-unreachable.c: We don't add this one, since it touches
   the optimization level of the context as a whole.  */

/* test-calling-external-function.c */
#define create_code create_code_calling_external_function
#define verify_code verify_code_calling_external_function
#include "test-calling-external-function.c"
#undef create_code
#undef verify_code

/* test-calling-function-ptr.c */
#define create_code create_code_calling_function_ptr
#define verify_code verify_code_calling_function_ptr
#include "test-calling-function-ptr.c"
#undef create_code
#undef verify_code

/* test-returning-function-ptr.c */
#define create_code create_code_calling_internal_function
#define verify_code verify_code_calling_internal_function
#include "test-returning-function-ptr.c"
#undef create_code
#undef verify_code

/* test-cast.c */
#define create_code create_code_cast
#define verify_code verify_code_cast
#include "test-cast.c"
#undef create_code
#undef verify_code

/* test-compound-assignment.c */
#define create_code create_code_compound_assignment
#define verify_code verify_code_compound_assignment
#include "test-compound-assignment.c"
#undef create_code
#undef verify_code

/* test-constants.c */
#define create_code create_code_constants
#define verify_code verify_code_constants
#include "test-constants.c"
#undef create_code
#undef verify_code

/* test-debug-strings.c */
#define create_code create_code_debug_strings
#define verify_code verify_code_debug_strings
#include "test-debug-strings.c"
#undef create_code
#undef verify_code

/* test-dot-product.c */
#define create_code create_code_dot_product
#define verify_code verify_code_dot_product
#include "test-dot-product.c"
#undef create_code
#undef verify_code

/* test-empty.c */
#define create_code create_code_empty
#define verify_code verify_code_empty
#include "test-empty.c"
#undef create_code
#undef verify_code

/* test-error-*.c: We don't use these test cases, since they deliberately
   introduce errors, which we don't want here.  */

/* test-expressions.c */
#define create_code create_code_expressions
#define verify_code verify_code_expressions
#include "test-expressions.c"
#undef create_code
#undef verify_code

/* test-extra-options.c: We don't use this one, since the extra options
   affect the whole context.  */

/* test-factorial.c */
#define create_code create_code_factorial
#define verify_code verify_code_factorial
#include "test-factorial.c"
#undef create_code
#undef verify_code

/* test-factorial-must-tail-call.c */
#define create_code create_code_factorial_must_tail_call
#define verify_code verify_code_factorial_must_tail_call
#include "test-factorial-must-tail-call.c"
#undef create_code
#undef verify_code

/* test-fibonacci.c */
#define create_code create_code_fibonacci
#define verify_code verify_code_fibonacci
#include "test-fibonacci.c"
#undef create_code
#undef verify_code

/* test-functions.c */
#define create_code create_code_functions
#define verify_code verify_code_functions
#include "test-functions.c"
#undef create_code
#undef verify_code

/* test-global-init-rvalue.c */
#define create_code create_code_global_init_rvalue
#define verify_code verify_code_global_init_rvalue
#include "test-global-init-rvalue.c"
#undef create_code
#undef verify_code

/* test-global-set-initializer.c */
#define create_code create_code_global_set_initializer
#define verify_code verify_code_global_set_initializer
#include "test-global-set-initializer.c"
#undef create_code
#undef verify_code

/* test-builtin-types.c */
#define create_code create_code_builtin_types
#define verify_code verify_code_builtin_types
#include "test-builtin-types.c"
#undef create_code
#undef verify_code

/* test-tls.c */
#define create_code create_code_tls
#define verify_code verify_code_tls
#include "test-tls.c"
#undef create_code
#undef verify_code

/* test-hello-world.c */
#define create_code create_code_hello_world
#define verify_code verify_code_hello_world
#include "test-hello-world.c"
#undef create_code
#undef verify_code

/* test-link-section-assembler.c: This can't be in the testcases array as it
   doesn't have a verify_code implementation.  */

/* test-linked-list.c */
#define create_code create_code_linked_list
#define verify_code verify_code_linked_list
#include "test-linked-list.c"
#undef create_code
#undef verify_code

/* test-local-init-rvalue.c */
#define create_code create_code_local_init_rvalue
#define verify_code verify_code_local_init_rvalue
#include "test-local-init-rvalue.c"
#undef create_code
#undef verify_code

/* test-long-names.c */
#define create_code create_code_long_names
#define verify_code verify_code_long_names
#include "test-long-names.c"
#undef create_code
#undef verify_code

/* test-long-string-literal.c */
#define create_code create_code_long_string_literal
#define verify_code verify_code_long_string_literal
#include "test-long-string-literal.c"
#undef create_code
#undef verify_code

/* test-quadratic.c */
#define create_code create_code_quadratic
#define verify_code verify_code_quadratic
#include "test-quadratic.c"
#undef create_code
#undef verify_code

/* test-nested-loops.c */
#define create_code create_code_nested_loop
#define verify_code verify_code_nested_loop
#include "test-nested-loops.c"
#undef create_code
#undef verify_code

/* test-pr103562.c: We don't add this one, since it touches
   the optimization level of the context as a whole.  */

/* test-pr66700-observing-write-through-ptr.c */
#define create_code create_code_pr66700_observing_write_through_ptr
#define verify_code verify_code_pr66700_observing_write_through_ptr
#include "test-pr66700-observing-write-through-ptr.c"
#undef create_code
#undef verify_code

/* test-pr66779.c */
#define create_code create_code_pr66779
#define verify_code verify_code_pr66779
#include "test-pr66779.c"
#undef create_code
#undef verify_code

/* test-pr95306-builtin-types.c.  */
#define create_code create_code_pr95306_builtin_types
#define verify_code verify_code_pr95306_builtin_types
#include "test-pr95306-builtin-types.c"
#undef create_code
#undef verify_code

/* test-pr95314-rvalue-reuse.c.  */
#define create_code create_code_pr95314_rvalue_reuse
#define verify_code verify_code_pr95314_rvalue_reuse
#include "test-pr95314-rvalue-reuse.c"
#undef create_code
#undef verify_code

/* test-reading-struct.c */
#define create_code create_code_reading_struct
#define verify_code verify_code_reading_struct
#include "test-reading-struct.c"
#undef create_code
#undef verify_code

/* test-reflection.c */
#define create_code create_code_reflection
#define verify_code verify_code_reflection
#include "test-reflection.c"
#undef create_code
#undef verify_code

/* test-string-literal.c */
#define create_code create_code_string_literal
#define verify_code verify_code_string_literal
#include "test-string-literal.c"
#undef create_code
#undef verify_code

/* test-sum-of-squares.c */
#define create_code create_code_sum_of_squares
#define verify_code verify_code_sum_of_squares
#include "test-sum-of-squares.c"
#undef create_code
#undef verify_code

/* test-switch.c */
#define create_code create_code_switch
#define verify_code verify_code_switch
#include "test-switch.c"
#undef create_code
#undef verify_code

/* test-types.c */
#define create_code create_code_types
#define verify_code verify_code_types
#include "test-types.c"
#undef create_code
#undef verify_code

/* test-using-global.c */
#define create_code create_code_using_global
#define verify_code verify_code_using_global
#include "test-using-global.c"
#undef create_code
#undef verify_code

/* test-validly-unreachable-block.c: We don't use this one, since the use
   of gcc_jit_context_set_bool_allow_unreachable_blocks affects the whole
   context.  */

/* test-vector-types.cc: We don't use this, since it's C++.  */

/* test-version.c */
#define create_code create_code_version
#define verify_code verify_code_version
#include "test-version.c"
#undef create_code
#undef verify_code

/* test-volatile.c */
#define create_code create_code_volatile
#define verify_code verify_code_volatile
#include "test-volatile.c"
#undef create_code
#undef verify_code

/* Now expose the individual testcases as instances of this struct.  */

struct testcase
{
  const char *m_name;
  void (*m_hook_to_create_code) (gcc_jit_context *ctxt,
				 void * user_data);
  void (*m_hook_to_verify_code) (gcc_jit_context *ctxt,
				 gcc_jit_result *result);
};

const struct testcase testcases[] = {
  {"accessing_bitfield",
   create_code_accessing_bitfield,
   verify_code_accessing_bitfield},
  {"accessing_struct",
   create_code_accessing_struct,
   verify_code_accessing_struct},
  {"accessing_union",
   create_code_accessing_union,
   verify_code_accessing_union},
  {"alignment",
   create_code_alignment,
   verify_code_alignment},
  {"arith_overflow",
   create_code_arith_overflow,
   verify_code_arith_overflow},
  {"array_as_pointer",
   create_code_array_as_pointer,
   verify_code_array_as_pointer},
  {"arrays",
   create_code_arrays,
   verify_code_arrays},
  {"autovectorize",
   create_code_autovectorize,
   verify_code_autovectorize},
  {"builtin-memcpy",
   create_code_builtin_memcpy,
   verify_code_builtin_memcpy},
  {"calling_external_function",
   create_code_calling_external_function,
   verify_code_calling_external_function},
  {"calling_function_ptr",
   create_code_calling_function_ptr,
   verify_code_calling_function_ptr},
  {"calling_internal_function",
   create_code_calling_internal_function,
   verify_code_calling_internal_function},
  {"cast",
   create_code_cast,
   verify_code_cast},
  {"compound_assignment",
   create_code_compound_assignment,
   verify_code_compound_assignment},
  {"constants",
   create_code_constants,
   verify_code_constants},
  {"debug_strings",
   create_code_debug_strings,
   verify_code_debug_strings},
  {"dot_product",
   create_code_dot_product,
   verify_code_dot_product},
  {"expressions",
   create_code_expressions,
   verify_code_expressions},
  {"empty",
   create_code_empty,
   verify_code_empty},
  {"factorial",
   create_code_factorial,
   verify_code_factorial},
  {"factorial_must_tail_call",
   create_code_factorial_must_tail_call,
   verify_code_factorial_must_tail_call},
  {"fibonacci",
   create_code_fibonacci,
   verify_code_fibonacci},
  {"functions",
   create_code_functions,
   verify_code_functions},
  {"builtin-types",
   create_code_builtin_types,
   verify_code_builtin_types},
  {"global_rvalue_init",
   create_code_global_init_rvalue,
   verify_code_global_init_rvalue},
  {"hello_world",
   create_code_hello_world,
   verify_code_hello_world},
  {"linked_list",
   create_code_linked_list,
   verify_code_linked_list},
  {"local_rvalue_init",
   create_code_local_init_rvalue,
   verify_code_local_init_rvalue},
  {"long_names",
   create_code_long_names,
   verify_code_long_names},
  {"long_string_literal",
   create_code_long_string_literal,
   verify_code_long_string_literal},
  {"quadratic",
   create_code_quadratic,
   verify_code_quadratic},
  {"nested_loop",
   create_code_nested_loop,
   verify_code_nested_loop},
  {"pr66700_observing_write_through_ptr",
   create_code_pr66700_observing_write_through_ptr,
   verify_code_pr66700_observing_write_through_ptr},
  {"pr66779",
   create_code_pr66779,
   verify_code_pr66779},
  {"pr95306_builtin_types",
   create_code_pr95306_builtin_types,
   verify_code_pr95306_builtin_types},
  {"pr95314_rvalue_reuse",
   create_code_pr95314_rvalue_reuse,
   verify_code_pr95314_rvalue_reuse},
  {"reading_struct ",
   create_code_reading_struct ,
   verify_code_reading_struct },
  {"reflection",
   create_code_reflection ,
   verify_code_reflection },
  {"string_literal",
   create_code_string_literal,
   verify_code_string_literal},
  {"sum_of_squares",
   create_code_sum_of_squares,
   verify_code_sum_of_squares},
  {"switch",
   create_code_switch,
   verify_code_switch},
  {"tls",
   create_code_tls,
   verify_code_tls},
  {"types",
   create_code_types,
   verify_code_types},
  {"using_global",
   create_code_using_global,
   verify_code_using_global},
  {"version",
   create_code_version,
   verify_code_version},
  {"volatile",
   create_code_volatile,
   verify_code_volatile}
};

const int num_testcases = (sizeof (testcases) / sizeof (testcases[0]));