Recommits the changes from https://reviews.llvm.org/D148216. Explicitly named globals are now matched literally, instead of emitting a capture group for the name. This resolves #70047. Metadata and annotations, on the other hand, are captured and matched against by default, since their identifiers are not stable. The reasons for revert (#63746) have been fixed: The first issue, that of duplicated checkers, has already been resolved in #70050. This PR resolves the second issue listed in #63746, regarding the order of named and unnamed globals. This is fixed by recording the index of substrings containing global values, and sorting the checks according to that index before emitting them. This results in global value checks being emitted in the order they were seen instead of being grouped separately.
25 lines
1.6 KiB
Plaintext
25 lines
1.6 KiB
Plaintext
## Test that CHECK lines are generated for clang-generated functions
|
|
|
|
# RUN: cp %S/Inputs/generated-funcs.c %t-generated.c && %update_cc_test_checks --include-generated-funcs --check-globals smart %t-generated.c
|
|
# RUN: diff -u %S/Inputs/generated-funcs.c.generated.expected %t-generated.c
|
|
# RUN: cp %S/Inputs/generated-funcs.c %t-no-generated.c && %update_cc_test_checks --check-globals smart %t-no-generated.c
|
|
# RUN: diff -u %S/Inputs/generated-funcs.c.no-generated.expected %t-no-generated.c
|
|
|
|
## Check that re-running update_cc_test_checks doesn't change the output
|
|
# RUN: %update_cc_test_checks --include-generated-funcs %t-generated.c
|
|
# RUN: diff -u %S/Inputs/generated-funcs.c.generated.expected %t-generated.c
|
|
# RUN: %update_cc_test_checks %t-no-generated.c
|
|
# RUN: diff -u %S/Inputs/generated-funcs.c.no-generated.expected %t-no-generated.c
|
|
|
|
## Same as above for --check-globals all
|
|
# RUN: cp %S/Inputs/generated-funcs.c %t-generated.c && %update_cc_test_checks --include-generated-funcs --check-globals all %t-generated.c
|
|
# RUN: diff -u %S/Inputs/generated-funcs.c.generated.all.expected %t-generated.c
|
|
# RUN: cp %S/Inputs/generated-funcs.c %t-no-generated.c && %update_cc_test_checks --check-globals all %t-no-generated.c
|
|
# RUN: diff -u %S/Inputs/generated-funcs.c.no-generated.all.expected %t-no-generated.c
|
|
|
|
## Check that re-running update_cc_test_checks doesn't change the output
|
|
# RUN: %update_cc_test_checks --include-generated-funcs %t-generated.c
|
|
# RUN: diff -u %S/Inputs/generated-funcs.c.generated.all.expected %t-generated.c
|
|
# RUN: %update_cc_test_checks %t-no-generated.c
|
|
# RUN: diff -u %S/Inputs/generated-funcs.c.no-generated.all.expected %t-no-generated.c
|