[UTC] Enable --function-signature by default
authorNikita Popov <npopov@redhat.com>
Thu, 2 Mar 2023 09:25:48 +0000 (10:25 +0100)
committerNikita Popov <npopov@redhat.com>
Tue, 7 Mar 2023 09:27:52 +0000 (10:27 +0100)
commitfb309041f0c37fa2798305ae02cf6910bf0b402b
tree8bcd88d6a27dc657192cc007e1580f02ec5c885b
parent144e2364410cc57e919eee38402bc5347f1d57b8
[UTC] Enable --function-signature by default

This patch enables --function-signature by default under --version 2
and makes --version 2 the default. This means that all newly created
tests will check the function signature, while leaving old tests alone.

There's two motivations for this change:

* Without --function-signature, the generated check lines may fail
  in a very hard to understand way if the test both includes a
  function definition and a call to that function. (Though we could
  address this by making the CHECK-LABEL stricter, without checking
  the full signature.)
* This actually checks that uses of the arguments in the function
  body use the correct argument, instead of matching against any
  variable.

This is a replacement for D139006 and D140212 based on the
--version mechanism.

I did not include an opt-out flag --no-function-signature because
I'm not sure we need it. Would be happy to include it though,
if desired.

Differential Revision: https://reviews.llvm.org/D145149
clang/test/utils/update_cc_test_checks/Inputs/mangled_names.c.funcsig.v2.expected
clang/test/utils/update_cc_test_checks/Inputs/mangled_names.c.v2.expected [new file with mode: 0644]
clang/test/utils/update_cc_test_checks/mangled_names.test
llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/basic.ll.v2.expected [new file with mode: 0644]
llvm/test/tools/UpdateTestChecks/update_test_checks/basic.test
llvm/utils/UpdateTestChecks/common.py