Mercurial > hg > CbC > CbC_llvm
comparison mlir/test/lit.cfg.py @ 207:2e18cbf3894f
LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:07:14 +0900 |
parents | 0572611fdcc8 |
children | 5f17cb93ff66 |
comparison
equal
deleted
inserted
replaced
173:0572611fdcc8 | 207:2e18cbf3894f |
---|---|
19 config.name = 'MLIR' | 19 config.name = 'MLIR' |
20 | 20 |
21 config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell) | 21 config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell) |
22 | 22 |
23 # suffixes: A list of file extensions to treat as test files. | 23 # suffixes: A list of file extensions to treat as test files. |
24 config.suffixes = ['.td', '.mlir', '.toy', '.ll', '.tc'] | 24 config.suffixes = ['.td', '.mlir', '.toy', '.ll', '.tc', '.py', '.yaml', '.test'] |
25 | 25 |
26 # test_source_root: The root path where tests are located. | 26 # test_source_root: The root path where tests are located. |
27 config.test_source_root = os.path.dirname(__file__) | 27 config.test_source_root = os.path.dirname(__file__) |
28 | 28 |
29 # test_exec_root: The root path where tests should be run. | 29 # test_exec_root: The root path where tests should be run. |
39 llvm_config.use_default_substitutions() | 39 llvm_config.use_default_substitutions() |
40 | 40 |
41 # excludes: A list of directories to exclude from the testsuite. The 'Inputs' | 41 # excludes: A list of directories to exclude from the testsuite. The 'Inputs' |
42 # subdirectories contain auxiliary inputs for various tests in their parent | 42 # subdirectories contain auxiliary inputs for various tests in their parent |
43 # directories. | 43 # directories. |
44 config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt'] | 44 config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt', |
45 'lit.cfg.py', 'lit.site.cfg.py'] | |
45 | 46 |
46 # test_source_root: The root path where tests are located. | 47 # test_source_root: The root path where tests are located. |
47 config.test_source_root = os.path.dirname(__file__) | 48 config.test_source_root = os.path.dirname(__file__) |
48 | 49 |
49 # test_exec_root: The root path where tests should be run. | 50 # test_exec_root: The root path where tests should be run. |
55 tool_dirs = [config.mlir_tools_dir, config.llvm_tools_dir] | 56 tool_dirs = [config.mlir_tools_dir, config.llvm_tools_dir] |
56 tools = [ | 57 tools = [ |
57 'mlir-opt', | 58 'mlir-opt', |
58 'mlir-tblgen', | 59 'mlir-tblgen', |
59 'mlir-translate', | 60 'mlir-translate', |
60 'mlir-edsc-builder-api-test', | 61 'mlir-lsp-server', |
62 'mlir-capi-ir-test', | |
63 'mlir-capi-pass-test', | |
64 'mlir-cpu-runner', | |
65 'mlir-linalg-ods-gen', | |
66 'mlir-linalg-ods-yaml-gen', | |
67 'mlir-reduce', | |
68 'mlir-sdbm-api-test', | |
61 ] | 69 ] |
62 | 70 |
63 # The following tools are optional | 71 # The following tools are optional |
64 tools.extend([ | 72 tools.extend([ |
73 ToolSubst('%PYTHON', config.python_executable, unresolved='ignore'), | |
65 ToolSubst('toy-ch1', unresolved='ignore'), | 74 ToolSubst('toy-ch1', unresolved='ignore'), |
66 ToolSubst('toy-ch2', unresolved='ignore'), | 75 ToolSubst('toy-ch2', unresolved='ignore'), |
67 ToolSubst('toy-ch3', unresolved='ignore'), | 76 ToolSubst('toy-ch3', unresolved='ignore'), |
68 ToolSubst('toy-ch4', unresolved='ignore'), | 77 ToolSubst('toy-ch4', unresolved='ignore'), |
69 ToolSubst('toy-ch5', unresolved='ignore'), | 78 ToolSubst('toy-ch5', unresolved='ignore'), |
70 ToolSubst('%cuda_wrapper_library_dir', config.cuda_wrapper_library_dir, unresolved='ignore'), | |
71 ToolSubst('%linalg_test_lib_dir', config.linalg_test_lib_dir, unresolved='ignore'), | 79 ToolSubst('%linalg_test_lib_dir', config.linalg_test_lib_dir, unresolved='ignore'), |
72 ToolSubst('%mlir_runner_utils_dir', config.mlir_runner_utils_dir, unresolved='ignore'), | 80 ToolSubst('%mlir_runner_utils_dir', config.mlir_runner_utils_dir, unresolved='ignore'), |
73 ToolSubst('%vulkan_wrapper_library_dir', config.vulkan_wrapper_library_dir, unresolved='ignore') | 81 ToolSubst('%spirv_wrapper_library_dir', config.spirv_wrapper_library_dir, unresolved='ignore'), |
82 ToolSubst('%vulkan_wrapper_library_dir', config.vulkan_wrapper_library_dir, unresolved='ignore'), | |
83 ToolSubst('%mlir_integration_test_dir', config.mlir_integration_test_dir, unresolved='ignore'), | |
74 ]) | 84 ]) |
85 llvm_config.add_tool_substitutions(tools, tool_dirs) | |
75 | 86 |
76 llvm_config.add_tool_substitutions(tools, tool_dirs) | 87 |
88 # FileCheck -enable-var-scope is enabled by default in MLIR test | |
89 # This option avoids to accidentally reuse variable across -LABEL match, | |
90 # it can be explicitly opted-in by prefixing the variable name with $ | |
91 config.environment['FILECHECK_OPTS'] = "-enable-var-scope --allow-unused-prefixes=false" | |
92 | |
93 | |
94 # LLVM can be configured with an empty default triple | |
95 # by passing ` -DLLVM_DEFAULT_TARGET_TRIPLE="" `. | |
96 # This is how LLVM filters tests that require the host target | |
97 # to be available for JIT tests. | |
98 if config.target_triple: | |
99 config.available_features.add('default_triple') | |
100 | |
101 # Add the python path for both the source and binary tree. | |
102 # Note that presently, the python sources come from the source tree and the | |
103 # binaries come from the build tree. This should be unified to the build tree | |
104 # by copying/linking sources to build. | |
105 if config.enable_bindings_python: | |
106 llvm_config.with_environment('PYTHONPATH', [ | |
107 # TODO: Don't reference the llvm_obj_root here: the invariant is that | |
108 # the python/ must be at the same level of the lib directory | |
109 # where libMLIR.so is installed. This is presently not optimal from a | |
110 # project separation perspective and a discussion on how to better | |
111 # segment MLIR libraries needs to happen. See also | |
112 # lib/Bindings/Python/CMakeLists.txt for where this is set up. | |
113 os.path.join(config.llvm_obj_root, 'python'), | |
114 ], append_path=True) |