forked from lcompilers/lpython
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
552 lines (517 loc) · 25 KB
/
CMakeLists.txt
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
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(lpython_tests C)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug
CACHE STRING "Build type (Debug, Release)" FORCE)
endif ()
if (NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR
CMAKE_BUILD_TYPE STREQUAL "Release"))
message("${CMAKE_BUILD_TYPE}")
message(FATAL_ERROR "CMAKE_BUILD_TYPE must be one of: Debug, Release (current value: '${CMAKE_BUILD_TYPE}')")
endif ()
set(KIND no CACHE STRING "Type of Test")
find_path(LPYTHON_RTLIB_DIR lfortran_intrinsics.h
${CMAKE_SOURCE_DIR}/../src/libasr/runtime)
find_library(LPYTHON_RTLIB_LIBRARY lpython_runtime_static
${CMAKE_SOURCE_DIR}/../src/runtime/)
add_library(lpython_rtlib INTERFACE IMPORTED)
set_property(TARGET lpython_rtlib PROPERTY INTERFACE_INCLUDE_DIRECTORIES
${LPYTHON_RTLIB_DIR})
set_property(TARGET lpython_rtlib PROPERTY INTERFACE_LINK_LIBRARIES
${LPYTHON_RTLIB_LIBRARY})
target_link_libraries(lpython_rtlib INTERFACE m)
enable_testing()
message("\n")
message("Configuration results")
message("---------------------")
message("C compiler : ${CMAKE_C_COMPILER}")
message("Build type: ${CMAKE_BUILD_TYPE}")
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
message("C compiler flags : ${CMAKE_C_FLAGS_DEBUG}")
else ()
message("C compiler flags : ${CMAKE_C_FLAGS_RELEASE}")
endif ()
message("Installation prefix: ${CMAKE_INSTALL_PREFIX}")
message("KIND: ${KIND}")
message("LPYTHON_RTLIB_DIR: ${LPYTHON_RTLIB_DIR}")
message("LPYTHON_RTLIB_LIBRARY: ${LPYTHON_RTLIB_LIBRARY}")
macro(RUN)
set(options FAIL)
set(oneValueArgs NAME IMPORT_PATH)
set(multiValueArgs LABELS EXTRAFILES)
cmake_parse_arguments(RUN "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN} )
set(name ${RUN_NAME})
set(import_path ${RUN_IMPORT_PATH})
if (NOT name)
message(FATAL_ERROR "Must specify the NAME argument")
endif()
if (${KIND} IN_LIST RUN_LABELS)
if (KIND STREQUAL "llvm")
if (import_path)
add_custom_command(
OUTPUT ${name}.o
COMMAND lpython -c -I ${CMAKE_CURRENT_SOURCE_DIR}/${import_path} ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py -o ${name}.o
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py
VERBATIM)
else ()
add_custom_command(
OUTPUT ${name}.o
COMMAND lpython -c ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py -o ${name}.o
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py
VERBATIM)
endif()
add_executable(${name} ${name}.o ${RUN_EXTRAFILES})
set_target_properties(${name} PROPERTIES LINKER_LANGUAGE C)
target_link_libraries(${name} lpython_rtlib)
add_test(${name} ${CMAKE_CURRENT_BINARY_DIR}/${name})
if (RUN_LABELS)
set_tests_properties(${name} PROPERTIES LABELS "${RUN_LABELS}")
endif()
if (${RUN_FAIL})
set_tests_properties(${name} PROPERTIES WILL_FAIL TRUE)
endif()
elseif(KIND STREQUAL "c")
if (import_path)
add_custom_command(
OUTPUT ${name}.c
COMMAND lpython -I ${CMAKE_CURRENT_SOURCE_DIR}/${import_path} --show-c ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py > ${name}.c
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py
VERBATIM)
else ()
add_custom_command(
OUTPUT ${name}.c
COMMAND lpython --show-c ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py > ${name}.c
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py
VERBATIM)
endif()
add_executable(${name} ${name}.c ${RUN_EXTRAFILES})
target_include_directories(${name} PRIVATE ${CMAKE_SOURCE_DIR})
set_target_properties(${name} PROPERTIES LINKER_LANGUAGE C)
target_link_libraries(${name} lpython_rtlib)
add_test(${name} ${CMAKE_CURRENT_BINARY_DIR}/${name})
if (RUN_LABELS)
set_tests_properties(${name} PROPERTIES LABELS "${RUN_LABELS}")
endif()
if (${RUN_FAIL})
set_tests_properties(${name} PROPERTIES WILL_FAIL TRUE)
endif()
elseif(KIND STREQUAL "cpython")
# CPython test
if (RUN_EXTRAFILES)
set(PY_MOD "${name}_mod")
add_library(${PY_MOD} SHARED ${RUN_EXTRAFILES})
set_target_properties(${PY_MOD} PROPERTIES LINKER_LANGUAGE C)
else()
set(PY_MOD "")
endif()
add_test(${name} python ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py)
set_tests_properties(${name} PROPERTIES
ENVIRONMENT "PYTHONPATH=${CMAKE_SOURCE_DIR}/../src/runtime/lpython:${CMAKE_SOURCE_DIR}/..;LPYTHON_PY_MOD_NAME=${PY_MOD};LPYTHON_PY_MOD_PATH=${CMAKE_CURRENT_BINARY_DIR}")
if (RUN_LABELS)
set_tests_properties(${name} PROPERTIES LABELS "${RUN_LABELS}")
endif()
if (${RUN_FAIL})
set_tests_properties(${name} PROPERTIES WILL_FAIL TRUE)
endif()
elseif(KIND STREQUAL "x86")
# x86 test
add_custom_command(
OUTPUT ${name}.x86
COMMAND lpython --backend x86 ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py -o ${name}.x86
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py
VERBATIM
)
add_custom_target(${name} ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${name}.x86)
add_test(${name} ${CMAKE_CURRENT_BINARY_DIR}/${name}.x86)
if (RUN_LABELS)
set_tests_properties(${name} PROPERTIES LABELS "${RUN_LABELS}")
endif()
if (${RUN_FAIL})
set_tests_properties(${name} PROPERTIES WILL_FAIL TRUE)
endif()
elseif(KIND STREQUAL "wasm_x86")
# wasm_to_x86 test
add_custom_command(
OUTPUT ${name}.x86
COMMAND lpython --backend wasm_x86 ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py -o ${name}.x86
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py
VERBATIM
)
add_custom_target(${name} ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${name}.x86)
add_test(${name} ${CMAKE_CURRENT_BINARY_DIR}/${name}.x86)
if (RUN_LABELS)
set_tests_properties(${name} PROPERTIES LABELS "${RUN_LABELS}")
endif()
if (${RUN_FAIL})
set_tests_properties(${name} PROPERTIES WILL_FAIL TRUE)
endif()
elseif(KIND STREQUAL "wasm_x64")
# wasm_to_x64 test
add_custom_command(
OUTPUT ${name}.x64
COMMAND lpython --backend wasm_x64 ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py -o ${name}.x64
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py
VERBATIM
)
add_custom_target(${name} ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${name}.x64)
add_test(${name} ${CMAKE_CURRENT_BINARY_DIR}/${name}.x64)
if (RUN_LABELS)
set_tests_properties(${name} PROPERTIES LABELS "${RUN_LABELS}")
endif()
if (${RUN_FAIL})
set_tests_properties(${name} PROPERTIES WILL_FAIL TRUE)
endif()
elseif(KIND STREQUAL "wasm")
# wasm test
execute_process(COMMAND lpython --backend wasm ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py -o ${name})
find_program(WASM_EXEC_RUNTIME node)
execute_process(COMMAND "${WASM_EXEC_RUNTIME}" --version
OUTPUT_VARIABLE WASM_EXEC_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(COMPARE GREATER_EQUAL "${WASM_EXEC_VERSION}"
"v16.0.0" IS_NODE_ABOVE_16)
if (NOT IS_NODE_ABOVE_16)
message(STATUS "${WASM_EXEC_RUNTIME} version: ${WASM_EXEC_VERSION}")
set(WASM_EXEC_FLAGS "--experimental-wasm-bigint")
endif()
set(WASM_EXEC_FLAGS ${WASM_EXEC_FLAGS} "--experimental-wasi-unstable-preview1")
add_test(${name} ${WASM_EXEC_RUNTIME} ${WASM_EXEC_FLAGS} ${CMAKE_CURRENT_BINARY_DIR}/${name}.js)
if (RUN_LABELS)
set_tests_properties(${name} PROPERTIES LABELS "${RUN_LABELS}")
endif()
if (${RUN_FAIL})
set_tests_properties(${name} PROPERTIES WILL_FAIL TRUE)
endif()
endif()
endif()
endmacro(RUN)
# only compiles till object file
# to make sure that the generated code is syntactically correct
# but we cannot generate an executable due to --disable-main option enabled.
macro(COMPILE)
set(options FAIL)
set(oneValueArgs NAME IMPORT_PATH)
set(multiValueArgs LABELS EXTRAFILES)
cmake_parse_arguments(COMPILE "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN} )
set(name ${COMPILE_NAME})
set(import_path ${COMPILE_IMPORT_PATH})
if (NOT name)
message(FATAL_ERROR "Must specify the NAME argument")
endif()
if (${KIND} IN_LIST COMPILE_LABELS)
if (KIND STREQUAL "llvm")
if (import_path)
add_custom_command(
OUTPUT ${name}.o
COMMAND lpython --disable-main -c -I ${CMAKE_CURRENT_SOURCE_DIR}/${import_path} ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py -o ${name}.o
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py
VERBATIM)
else ()
add_custom_command(
OUTPUT ${name}.o
COMMAND lpython --disable-main -c ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py -o ${name}.o
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py
VERBATIM)
endif()
add_library(${name} OBJECT ${name}.o)
elseif(KIND STREQUAL "c")
if (import_path)
add_custom_command(
OUTPUT ${name}.c
COMMAND lpython --disable-main -I ${CMAKE_CURRENT_SOURCE_DIR}/${import_path} --show-c ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py > ${name}.c
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py
VERBATIM)
else ()
add_custom_command(
OUTPUT ${name}.c
COMMAND lpython --disable-main --show-c ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py > ${name}.c
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py
VERBATIM)
endif()
add_library(${name} OBJECT ${name}.c)
target_link_libraries(${name} lpython_rtlib)
elseif(KIND STREQUAL "cpython")
# CPython test
set(PY_MOD "")
add_test(${name} python ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py)
set_tests_properties(${name} PROPERTIES
ENVIRONMENT "PYTHONPATH=${CMAKE_SOURCE_DIR}/../src/runtime/lpython:${CMAKE_SOURCE_DIR}/..;LPYTHON_PY_MOD_NAME=${PY_MOD};LPYTHON_PY_MOD_PATH=${CMAKE_CURRENT_BINARY_DIR}")
if (RUN_LABELS)
set_tests_properties(${name} PROPERTIES LABELS "${RUN_LABELS}")
endif()
if (${RUN_FAIL})
set_tests_properties(${name} PROPERTIES WILL_FAIL TRUE)
endif()
endif()
endif()
endmacro(COMPILE)
# Test zero and non-zero exit code and assert statements
RUN(NAME array_01_decl LABELS cpython llvm c)
RUN(NAME array_02_decl LABELS cpython llvm c)
RUN(NAME array_03_decl LABELS cpython llvm c)
RUN(NAME variable_decl_01 LABELS cpython llvm c)
RUN(NAME variable_decl_02 LABELS cpython llvm c)
RUN(NAME variable_decl_03 LABELS cpython llvm c)
RUN(NAME array_expr_01 LABELS cpython llvm c)
RUN(NAME array_expr_02 LABELS cpython llvm c)
RUN(NAME array_size_01 LABELS cpython llvm c)
RUN(NAME array_size_02 LABELS cpython llvm c)
RUN(NAME array_01 LABELS cpython llvm wasm c)
RUN(NAME array_02 LABELS cpython wasm c)
RUN(NAME bindc_01 LABELS cpython llvm c)
RUN(NAME bindc_02 LABELS cpython llvm c)
RUN(NAME bindc_04 LABELS llvm c)
RUN(NAME bindc_07 LABELS cpython llvm c)
RUN(NAME exit_01 LABELS cpython llvm c)
RUN(NAME exit_02 FAIL LABELS cpython llvm c)
RUN(NAME exit_03 LABELS cpython llvm c wasm wasm_x86 wasm_x64)
RUN(NAME exit_04 FAIL LABELS cpython llvm c wasm wasm_x86 wasm_x64)
RUN(NAME exit_01b LABELS cpython llvm c wasm wasm_x86 wasm_x64)
RUN(NAME exit_02b FAIL LABELS cpython llvm c wasm wasm_x86 wasm_x64)
RUN(NAME exit_02c FAIL LABELS cpython llvm c)
# Test all four backends
RUN(NAME print_01 LABELS cpython llvm c wasm) # wasm not yet supports sep and end keywords
RUN(NAME print_03 LABELS x86 c wasm wasm_x86 wasm_x64) # simple test case specifically for x86, wasm_x86 and wasm_x64
RUN(NAME print_04 LABELS cpython llvm c)
RUN(NAME print_06 LABELS cpython llvm c)
RUN(NAME print_05 LABELS cpython llvm c wasm wasm_x64)
RUN(NAME print_float LABELS cpython llvm c wasm wasm_x64)
RUN(NAME print_list_tuple_01 LABELS cpython llvm c)
RUN(NAME print_list_tuple_02 LABELS cpython llvm c)
# CPython and LLVM
RUN(NAME const_01 LABELS cpython llvm c)
RUN(NAME const_02 LABELS cpython llvm c)
RUN(NAME const_03 LABELS cpython llvm c
EXTRAFILES const_03b.c)
RUN(NAME const_04 LABELS cpython llvm c)
RUN(NAME expr_01 LABELS cpython llvm c wasm wasm_x64)
RUN(NAME expr_02 LABELS cpython llvm c wasm wasm_x64)
RUN(NAME expr_03 LABELS cpython llvm c wasm wasm_x64)
RUN(NAME expr_04 LABELS cpython llvm c wasm)
RUN(NAME expr_05 LABELS cpython llvm c)
RUN(NAME expr_06 LABELS cpython llvm c)
RUN(NAME expr_07 LABELS cpython llvm c)
RUN(NAME expr_08 LABELS llvm c)
RUN(NAME expr_09 LABELS cpython llvm c)
RUN(NAME expr_10 LABELS cpython llvm c)
RUN(NAME expr_11 LABELS cpython llvm c wasm)
RUN(NAME expr_12 LABELS llvm c)
RUN(NAME expr_13 LABELS llvm c
EXTRAFILES expr_13b.c)
RUN(NAME expr_14 LABELS cpython llvm c)
RUN(NAME expr_15 LABELS cpython llvm c)
RUN(NAME expr_01u LABELS cpython llvm c)
RUN(NAME expr_02u LABELS cpython llvm c)
RUN(NAME expr_03u LABELS cpython llvm c)
RUN(NAME loop_01 LABELS cpython llvm c)
RUN(NAME loop_02 LABELS cpython llvm c wasm wasm_x86 wasm_x64)
RUN(NAME loop_03 LABELS cpython llvm c wasm wasm_x64)
RUN(NAME loop_04 LABELS cpython llvm c)
RUN(NAME loop_05 LABELS cpython llvm c)
RUN(NAME if_01 LABELS cpython llvm c wasm wasm_x86 wasm_x64)
RUN(NAME if_02 LABELS cpython llvm c wasm wasm_x86 wasm_x64)
RUN(NAME if_03 FAIL LABELS cpython llvm c)
RUN(NAME print_02 LABELS cpython llvm c)
RUN(NAME test_types_01 LABELS cpython llvm c)
RUN(NAME test_types_02 LABELS cpython llvm c wasm)
RUN(NAME test_str_01 LABELS cpython llvm c)
RUN(NAME test_str_02 LABELS cpython llvm c)
RUN(NAME test_str_03 LABELS cpython llvm c)
RUN(NAME test_list_01 LABELS cpython llvm c)
RUN(NAME test_list_02 LABELS cpython llvm c)
RUN(NAME test_list_03 LABELS cpython llvm c)
RUN(NAME test_list_04 LABELS cpython llvm c)
RUN(NAME test_list_05 LABELS cpython llvm c)
RUN(NAME test_list_06 LABELS cpython llvm c)
RUN(NAME test_list_07 LABELS cpython llvm c)
RUN(NAME test_list_08 LABELS cpython llvm c)
RUN(NAME test_list_09 LABELS cpython llvm c)
RUN(NAME test_list_10 LABELS cpython llvm c)
RUN(NAME test_list_section LABELS cpython llvm c)
RUN(NAME test_list_count LABELS cpython llvm)
RUN(NAME test_list_index LABELS cpython llvm)
RUN(NAME test_tuple_01 LABELS cpython llvm c)
RUN(NAME test_tuple_02 LABELS cpython llvm c)
RUN(NAME test_tuple_03 LABELS cpython llvm c)
RUN(NAME test_dict_01 LABELS cpython llvm c)
RUN(NAME test_dict_02 LABELS cpython llvm c)
RUN(NAME test_dict_03 LABELS cpython llvm)
RUN(NAME test_dict_04 LABELS cpython llvm)
RUN(NAME test_dict_05 LABELS cpython llvm)
RUN(NAME test_dict_06 LABELS cpython llvm c)
RUN(NAME test_dict_07 LABELS cpython llvm)
RUN(NAME test_dict_08 LABELS cpython llvm c)
RUN(NAME test_dict_09 LABELS cpython llvm c)
RUN(NAME test_dict_10 LABELS cpython llvm) # TODO: Add support of dict with string in C backend
RUN(NAME test_dict_11 LABELS cpython llvm c)
RUN(NAME test_dict_bool LABELS cpython llvm)
RUN(NAME test_for_loop LABELS cpython llvm c)
RUN(NAME modules_01 LABELS cpython llvm c wasm wasm_x86 wasm_x64)
RUN(NAME modules_02 LABELS cpython llvm c wasm wasm_x86 wasm_x64)
RUN(NAME test_import_01 LABELS cpython llvm c)
RUN(NAME test_import_02 LABELS cpython llvm c)
RUN(NAME test_import_03 LABELS cpython llvm c)
RUN(NAME test_import_04 IMPORT_PATH ..
LABELS cpython llvm c)
RUN(NAME test_import_05 LABELS cpython llvm c wasm wasm_x86 wasm_x64)
RUN(NAME test_math LABELS cpython llvm)
RUN(NAME test_numpy_01 LABELS cpython llvm c)
RUN(NAME test_numpy_02 LABELS cpython llvm c)
RUN(NAME test_numpy_03 LABELS cpython llvm c)
RUN(NAME test_numpy_04 LABELS cpython llvm c)
RUN(NAME elemental_01 LABELS cpython llvm c)
RUN(NAME elemental_02 LABELS cpython llvm c)
RUN(NAME elemental_03 LABELS cpython llvm c)
RUN(NAME elemental_04 LABELS cpython llvm c)
RUN(NAME elemental_05 LABELS cpython llvm c)
RUN(NAME elemental_06 LABELS cpython llvm c)
RUN(NAME elemental_07 LABELS cpython llvm c)
RUN(NAME elemental_08 LABELS cpython llvm c)
RUN(NAME elemental_09 LABELS cpython llvm c)
RUN(NAME elemental_10 LABELS cpython llvm c)
RUN(NAME elemental_11 LABELS cpython llvm c)
RUN(NAME elemental_12 LABELS cpython llvm c)
RUN(NAME test_random LABELS cpython llvm)
RUN(NAME test_os LABELS cpython llvm c)
RUN(NAME test_builtin LABELS cpython llvm c)
RUN(NAME test_builtin_abs LABELS cpython llvm c)
RUN(NAME test_builtin_bool LABELS cpython llvm c)
RUN(NAME test_builtin_pow LABELS cpython llvm c)
RUN(NAME test_builtin_int LABELS cpython llvm c)
RUN(NAME test_builtin_len LABELS cpython llvm c)
RUN(NAME test_builtin_str LABELS cpython llvm c)
RUN(NAME test_builtin_oct LABELS cpython llvm c)
RUN(NAME test_builtin_hex LABELS cpython llvm c)
RUN(NAME test_builtin_bin LABELS cpython llvm c)
RUN(NAME test_builtin_float LABELS cpython llvm c)
RUN(NAME test_builtin_str_02 LABELS cpython llvm c)
RUN(NAME test_builtin_round LABELS cpython llvm c)
RUN(NAME test_builtin_divmod LABELS cpython llvm c)
RUN(NAME test_builtin_sum LABELS cpython llvm c)
RUN(NAME test_math1 LABELS cpython llvm c)
RUN(NAME test_math_02 LABELS cpython llvm)
RUN(NAME test_math_03 LABELS llvm) #1595: TODO: Test using CPython (3.11 recommended)
RUN(NAME test_pass_compare LABELS cpython llvm c)
RUN(NAME test_c_interop_01 LABELS cpython llvm c)
RUN(NAME test_c_interop_02 LABELS cpython llvm c
EXTRAFILES test_c_interop_02b.c)
RUN(NAME test_c_interop_03 LABELS cpython llvm c
EXTRAFILES test_c_interop_03b.c)
RUN(NAME test_c_interop_04 LABELS cpython llvm c
EXTRAFILES test_c_interop_04b.c)
RUN(NAME test_c_interop_05 LABELS llvm c
EXTRAFILES test_c_interop_05b.c)
RUN(NAME bindc_03 LABELS llvm c
EXTRAFILES bindc_03b.c)
RUN(NAME bindc_05 LABELS llvm c
EXTRAFILES bindc_05b.c)
RUN(NAME bindc_06 LABELS llvm c
EXTRAFILES bindc_06b.c)
RUN(NAME test_generics_01 LABELS cpython llvm c)
RUN(NAME test_cmath LABELS cpython llvm c)
RUN(NAME test_complex_01 LABELS cpython llvm c wasm wasm_x64)
RUN(NAME test_complex_02 LABELS cpython llvm c)
RUN(NAME test_max_min LABELS cpython llvm c)
RUN(NAME test_global LABELS cpython llvm c)
RUN(NAME test_global_decl LABELS cpython llvm c)
RUN(NAME test_integer_bitnot LABELS cpython llvm c wasm)
RUN(NAME test_ifexp LABELS cpython llvm c)
RUN(NAME test_unary_minus LABELS cpython llvm c)
RUN(NAME test_unary_plus LABELS cpython llvm c)
RUN(NAME test_bool_binop LABELS cpython llvm c)
RUN(NAME test_issue_518 LABELS cpython llvm c)
RUN(NAME structs_01 LABELS cpython llvm c)
RUN(NAME structs_02 LABELS cpython llvm c)
RUN(NAME structs_03 LABELS llvm c)
RUN(NAME structs_04 LABELS cpython llvm c)
RUN(NAME structs_05 LABELS llvm c)
RUN(NAME structs_06 LABELS cpython llvm c)
RUN(NAME structs_07 LABELS llvm c
EXTRAFILES structs_07b.c)
RUN(NAME structs_08 LABELS cpython llvm c)
RUN(NAME structs_09 LABELS cpython llvm c)
RUN(NAME structs_10 LABELS cpython llvm c)
RUN(NAME structs_11 LABELS cpython llvm c)
RUN(NAME structs_12 LABELS cpython llvm c)
RUN(NAME structs_13 LABELS llvm c
EXTRAFILES structs_13b.c)
RUN(NAME structs_14 LABELS cpython llvm c)
RUN(NAME structs_15 LABELS cpython llvm c)
RUN(NAME structs_16 LABELS cpython llvm c)
RUN(NAME structs_17 LABELS cpython llvm c)
RUN(NAME structs_18 LABELS cpython llvm c
EXTRAFILES structs_18b.c)
RUN(NAME structs_19 LABELS cpython llvm c
EXTRAFILES structs_19b.c)
RUN(NAME structs_20 LABELS cpython llvm c
EXTRAFILES structs_20b.c)
RUN(NAME structs_21 LABELS cpython llvm c)
RUN(NAME sizeof_01 LABELS llvm c
EXTRAFILES sizeof_01b.c)
RUN(NAME sizeof_02 LABELS cpython llvm c)
RUN(NAME enum_01 LABELS cpython llvm c)
RUN(NAME enum_02 LABELS cpython llvm)
RUN(NAME enum_03 LABELS cpython llvm c)
RUN(NAME enum_04 LABELS cpython llvm c)
RUN(NAME enum_05 LABELS llvm c
EXTRAFILES enum_05b.c)
RUN(NAME enum_06 LABELS cpython llvm c)
RUN(NAME enum_07 IMPORT_PATH ..
LABELS cpython llvm c)
RUN(NAME union_01 LABELS cpython llvm c)
RUN(NAME union_02 LABELS llvm c)
RUN(NAME union_03 LABELS cpython llvm c)
RUN(NAME test_str_to_int LABELS cpython llvm c)
RUN(NAME test_platform LABELS cpython llvm c)
RUN(NAME test_vars_01 LABELS cpython llvm)
RUN(NAME test_version LABELS cpython llvm)
RUN(NAME logical_binop1 LABELS cpython llvm)
RUN(NAME vec_01 LABELS cpython llvm c)
RUN(NAME test_str_comparison LABELS cpython llvm c)
RUN(NAME test_bit_length LABELS cpython llvm c)
RUN(NAME str_to_list_cast LABELS cpython llvm c)
RUN(NAME test_sys_01 LABELS cpython llvm c)
RUN(NAME test_package_01 LABELS cpython llvm)
RUN(NAME test_pkg_lpdraw LABELS cpython llvm wasm)
RUN(NAME test_pkg_lnn_01 LABELS cpython llvm)
RUN(NAME test_pkg_lnn_02 LABELS cpython llvm)
RUN(NAME generics_01 LABELS cpython llvm c)
RUN(NAME generics_02 LABELS cpython llvm c)
RUN(NAME generics_array_01 LABELS cpython llvm c)
RUN(NAME generics_array_02 LABELS cpython llvm c)
RUN(NAME generics_array_03 LABELS cpython llvm c)
RUN(NAME generics_list_01 LABELS cpython llvm c)
RUN(NAME test_statistics LABELS cpython llvm)
RUN(NAME test_str_attributes LABELS cpython llvm c)
RUN(NAME kwargs_01 LABELS cpython llvm c)
RUN(NAME test_01_goto LABELS cpython llvm c)
RUN(NAME func_inline_01 LABELS llvm c wasm)
RUN(NAME func_inline_02 LABELS cpython llvm c)
RUN(NAME func_static_01 LABELS cpython llvm c wasm)
RUN(NAME func_static_02 LABELS cpython llvm c wasm)
RUN(NAME func_dep_03 LABELS cpython llvm c)
RUN(NAME func_dep_04 LABELS cpython llvm c)
RUN(NAME float_01 LABELS cpython llvm c wasm wasm_x64)
RUN(NAME recursive_01 LABELS cpython llvm c wasm wasm_x64 wasm_x86)
RUN(NAME comp_01 LABELS cpython llvm c wasm wasm_x64)
RUN(NAME bit_operations_i32 LABELS cpython llvm c wasm wasm_x64)
RUN(NAME bit_operations_i64 LABELS cpython llvm c wasm)
RUN(NAME test_argv_01 LABELS cpython llvm)
RUN(NAME global_syms_01 LABELS cpython llvm c)
RUN(NAME global_syms_02 LABELS cpython llvm c)
RUN(NAME global_syms_03_b LABELS cpython llvm c)
RUN(NAME global_syms_03_c LABELS cpython llvm c)
RUN(NAME global_syms_04 LABELS cpython llvm c wasm wasm_x64)
RUN(NAME global_syms_05 LABELS cpython llvm c)
RUN(NAME global_syms_06 LABELS cpython llvm c)
RUN(NAME callback_01 LABELS cpython llvm)
# Intrinsic Functions
RUN(NAME intrinsics_01 LABELS cpython llvm) # any
# lpython decorator
RUN(NAME lpython_decorator_01 LABELS cpython)
COMPILE(NAME import_order_01 LABELS cpython llvm c) # any