Replace func name with regex for update test scripts
authorGiorgis Georgakoudis <georgakoudis1@llnl.gov>
Sat, 20 Feb 2021 04:22:14 +0000 (20:22 -0800)
committerGiorgis Georgakoudis <georgakoudis1@llnl.gov>
Sat, 13 Mar 2021 01:37:09 +0000 (17:37 -0800)
commit1ce846be04f8ce7f899e37424772c0bef1851f76
treedcde80304533d6ae2293696abe7b77632fd54863
parent22e9753271b71e2c067aadd5b877eef8198cadd2
Replace func name with regex for update test scripts

The patch adds an argument to update test scripts, such as update_cc_test_checks, for replacing a function name matching a regex. This functionality is needed to match generated function signatures that include file hashes. Example:

The function signature for the following function:

`__omp_offloading_50_b84c41e__Z9ftemplateIiET_i_l30_worker`

with `--replace-function-regex "__omp_offloading_[0-9]+_[a-z0-9]+_(.*)"` will become:

`CHECK-LABEL: @{{__omp_offloading_[0-9]+_[a-z0-9]+__Z9ftemplateIiET_i_l30_worker}}(`

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D97107
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs-regex.c [new file with mode: 0644]
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs-regex.c.expected [new file with mode: 0644]
clang/test/utils/update_cc_test_checks/generated-funcs-regex.test [new file with mode: 0644]
llvm/utils/UpdateTestChecks/common.py
llvm/utils/update_llc_test_checks.py