|
4 | 4 | import os |
5 | 5 | import lit.formats |
6 | 6 |
|
7 | | -from lit.llvm import llvm_config |
8 | | -from lit.llvm.subst import ToolSubst |
9 | | -from lit.llvm.subst import FindTool |
10 | | - |
11 | 7 | # Tell pylint that we know config and lit_config exist somewhere. |
12 | 8 | if 'PYLINT_IMPORT' in os.environ: |
13 | 9 | config = object() |
@@ -70,8 +66,6 @@ config.test_source_root = os.path.dirname(__file__) |
70 | 66 | # test_exec_root: The root object directory where output is placed |
71 | 67 | config.test_exec_root = config.libomptarget_obj_root |
72 | 68 |
|
73 | | -tools = [] |
74 | | - |
75 | 69 | # test format |
76 | 70 | config.test_format = lit.formats.ShTest() |
77 | 71 |
|
@@ -100,10 +94,6 @@ if config.has_libomptarget_ompt: |
100 | 94 |
|
101 | 95 | config.available_features.add(config.libomptarget_current_target) |
102 | 96 |
|
103 | | -if 'flang' in config.llvm_enabled_projects: |
104 | | - config.available_features.add('flang') |
105 | | - tools.append(ToolSubst('%flang', command=FindTool('flang-new'), unresolved='fatal')) |
106 | | - |
107 | 97 | if config.libomptarget_has_libc: |
108 | 98 | config.available_features.add('libc') |
109 | 99 |
|
@@ -320,11 +310,15 @@ for libomptarget_target in config.libomptarget_all_targets: |
320 | 310 |
|
321 | 311 | config.substitutions.append(("%clangxx", config.test_cxx_compiler)) |
322 | 312 | config.substitutions.append(("%clang", config.test_c_compiler)) |
| 313 | + |
| 314 | +if config.test_fortran_compiler: |
| 315 | + config.available_features.add('flang') |
| 316 | + config.substitutions.append(("%flang", config.test_fortran_compiler)) |
| 317 | + |
323 | 318 | config.substitutions.append(("%openmp_flags", config.test_openmp_flags)) |
324 | 319 | if config.libomptarget_current_target.startswith('nvptx') and config.cuda_path: |
325 | 320 | config.substitutions.append(("%cuda_flags", "--cuda-path=" + config.cuda_path)) |
326 | 321 | else: |
327 | 322 | config.substitutions.append(("%cuda_flags", "")) |
328 | 323 | config.substitutions.append(("%flags", config.test_flags)) |
329 | 324 | config.substitutions.append(("%not", config.libomptarget_not)) |
330 | | -llvm_config.add_tool_substitutions(tools, config.bin_llvm_tools_dir) |
0 commit comments