aboutsummaryrefslogtreecommitdiff
path: root/clang/test/utils
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2023-01-27 14:53:33 +0100
committerNikita Popov <npopov@redhat.com>2023-01-30 09:57:26 +0100
commit5375b638be874b5438e98bd8a435e198af3ef2d0 (patch)
tree924464d95e2376475278b26bfb87efb56ff8f96e /clang/test/utils
parentbfe63ed1fe922f0b7366eeda44649954c9631e24 (diff)
downloadllvm-5375b638be874b5438e98bd8a435e198af3ef2d0.zip
llvm-5375b638be874b5438e98bd8a435e198af3ef2d0.tar.gz
llvm-5375b638be874b5438e98bd8a435e198af3ef2d0.tar.bz2
[UTC] Add --version argument
We have a number of pending changes to update_test_checks.py (and friends) that are essentially blocked on test churn: If the output of UTC for an existing flag combination changes, then the next time a test is regenerated, it will contain many spurious changes. This makes changes to UTC default behavior essentially impossible. Examples of such changes are: * D133943/D142373 want --function-signature to also check the return type/attributes. * D139006/D140212 want to make --function-signature the default behavior. * D142452 wants to add wildcards for block labels. This patch tries to resolve this issue by adding a --version argument, which works as follows: * When regenerating an old test, the default version is 1. * When generating a new test, the default version is the newest. When an explicit version is specified, that of course wins. This means that any currently existing tests will keep using --version 1 format, while any new tests will automatically embed --version N where N is the latest version, and then keep using that test format from then on. This patch only implements the --version flag without bumping the default version, so it does not have any visible behavior change by itself. Differential Revision: https://reviews.llvm.org/D142473
Diffstat (limited to 'clang/test/utils')
-rw-r--r--clang/test/utils/update_cc_test_checks/lit.local.cfg4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/test/utils/update_cc_test_checks/lit.local.cfg b/clang/test/utils/update_cc_test_checks/lit.local.cfg
index b78c4ff..b461878 100644
--- a/clang/test/utils/update_cc_test_checks/lit.local.cfg
+++ b/clang/test/utils/update_cc_test_checks/lit.local.cfg
@@ -26,6 +26,10 @@ else:
extra_args = '--clang ' + shell_quote(clang_path)
opt_path = os.path.join(config.llvm_tools_dir, 'opt')
extra_args += ' --opt ' + shell_quote(opt_path)
+ # Specify an explicit default version in UTC tests, so that the --version
+ # embedded in UTC_ARGS does not change in all test expectations every time
+ # the default is bumped.
+ extra_args += ' --version=1'
script_path = os.path.join(config.llvm_src_root, 'utils',
'update_cc_test_checks.py')
assert os.path.isfile(script_path)