Eli Friedman | 3f2828d | 2021-07-30 20:17:45 | [diff] [blame] | 1 | @LIT_SITE_CFG_IN_HEADER@ |
| 2 | |
Tobias Grosser | 7580537 | 2011-04-29 06:27:02 | [diff] [blame] | 3 | config.llvm_src_root = "@LLVM_SOURCE_DIR@" |
| 4 | config.llvm_obj_root = "@LLVM_BINARY_DIR@" |
Sam McCall | 75acad4 | 2022-03-15 22:15:56 | [diff] [blame] | 5 | config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") |
| 6 | config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") |
Tobias Grosser | 7580537 | 2011-04-29 06:27:02 | [diff] [blame] | 7 | config.polly_obj_root = "@POLLY_BINARY_DIR@" |
Hongbin Zheng | c7584ff | 2012-03-16 14:34:20 | [diff] [blame] | 8 | config.polly_lib_dir = "@POLLY_LIB_DIR@" |
Petr Hosek | 0c0f6cfb | 2021-12-02 09:04:46 | [diff] [blame] | 9 | config.target_triple = "@LLVM_TARGET_TRIPLE@" |
serge_sans_paille | 24ab9b5 | 2019-06-08 15:37:47 | [diff] [blame] | 10 | config.llvm_polly_link_into_tools = "@LLVM_POLLY_LINK_INTO_TOOLS@" |
Tobias Grosser | 7d136d9 | 2017-03-03 03:38:50 | [diff] [blame] | 11 | config.targets_to_build = "@TARGETS_TO_BUILD@" |
Philip Pfaffe | d99c406 | 2017-07-11 11:24:25 | [diff] [blame] | 12 | config.extra_paths = "@POLLY_TEST_EXTRA_PATHS@".split(";") |
Tobias Grosser | 7580537 | 2011-04-29 06:27:02 | [diff] [blame] | 13 | |
Hongbin Zheng | e53bdfe | 2012-03-29 13:10:10 | [diff] [blame] | 14 | ## Check the current platform with regex |
| 15 | import re |
| 16 | EAT_ERR_ON_X86 = ' ' |
Eisuke Kawashima | b605dab | 2025-01-13 12:00:35 | [diff] [blame] | 17 | if (re.match(r'^x86_64*', '@LLVM_TARGET_TRIPLE@') is None) : |
Hongbin Zheng | e53bdfe | 2012-03-29 13:10:10 | [diff] [blame] | 18 | EAT_ERR_ON_X86 = '|| echo \"error is eaten\"' |
| 19 | |
Tobias Grosser | 7d136d9 | 2017-03-03 03:38:50 | [diff] [blame] | 20 | for arch in config.targets_to_build.split(): |
| 21 | config.available_features.add(arch.lower() + '-registered-target') |
| 22 | |
Tobias Grosser | 8fc6cdf | 2017-07-31 14:03:16 | [diff] [blame] | 23 | # excludes: A list of directories to exclude from the testsuite. The 'Inputs' |
| 24 | # subdirectories contain auxiliary inputs for various tests in their parent |
| 25 | # directories. |
| 26 | config.excludes = ['Inputs'] |
| 27 | |
Wael Yehia | c80198b | 2022-03-14 02:16:21 | [diff] [blame] | 28 | commonOpts = ' -polly-process-unprofitable ' \ |
| 29 | + ' -polly-remarks-minimal ' \ |
| 30 | + ' -polly-use-llvm-names ' \ |
| 31 | + ' -polly-import-jscop-dir=%S ' \ |
| 32 | + ' -polly-codegen-verify ' |
serge_sans_paille | 24ab9b5 | 2019-06-08 15:37:47 | [diff] [blame] | 33 | if config.llvm_polly_link_into_tools == '' or \ |
| 34 | config.llvm_polly_link_into_tools.lower() == '0' or \ |
| 35 | config.llvm_polly_link_into_tools.lower() == 'n' or \ |
| 36 | config.llvm_polly_link_into_tools.lower() == 'no' or \ |
| 37 | config.llvm_polly_link_into_tools.lower() == 'off' or \ |
| 38 | config.llvm_polly_link_into_tools.lower() == 'false' or \ |
| 39 | config.llvm_polly_link_into_tools.lower() == 'notfound' or \ |
| 40 | config.llvm_polly_link_into_tools.lower() == 'llvm_polly_link_into_tools-notfound': |
Eli Friedman | 1539758 | 2024-05-15 05:04:50 | [diff] [blame] | 41 | config.substitutions.append(('%loadPolly', '-load ' |
| 42 | + config.polly_lib_dir + '/LLVMPolly@LLVM_SHLIBEXT@' |
| 43 | + commonOpts )) |
| 44 | config.substitutions.append(('%loadNPMPolly', '-load-pass-plugin ' |
Philip Pfaffe | 8da7d1d | 2018-04-17 07:59:46 | [diff] [blame] | 45 | + config.polly_lib_dir + '/LLVMPolly@LLVM_SHLIBEXT@' |
Wael Yehia | c80198b | 2022-03-14 02:16:21 | [diff] [blame] | 46 | + commonOpts )) |
Sebastian Pop | 7537be9 | 2014-03-14 04:04:36 | [diff] [blame] | 47 | else: |
Wael Yehia | c80198b | 2022-03-14 02:16:21 | [diff] [blame] | 48 | config.substitutions.append(('%loadPolly', commonOpts )) |
Eli Friedman | 1539758 | 2024-05-15 05:04:50 | [diff] [blame] | 49 | config.substitutions.append(('%loadNPMPolly', commonOpts )) |
| 50 | |
Eli Friedman | 3f2828d | 2021-07-30 20:17:45 | [diff] [blame] | 51 | import lit.llvm |
| 52 | lit.llvm.initialize(lit_config, config) |
| 53 | |
Tobias Grosser | 7580537 | 2011-04-29 06:27:02 | [diff] [blame] | 54 | # Let the main config do the real work. |
Daniel Dunbar | 2bd59a2 | 2013-08-09 21:54:36 | [diff] [blame] | 55 | lit_config.load_config(config, "@POLLY_SOURCE_DIR@/test/lit.cfg") |