Page MenuHomePhabricator

[Utils] Check for more global information in update_test_checks
AcceptedPublic

Authored by jdoerfert on Jan 14 2021, 7:20 PM.

Details

Summary

This allows to check for various globals (metadata/attributes/...) and
also resolves problems with globals (metadata/attributes/...) being
reused across different prefixes.

Diff Detail

Unit TestsFailed

TimeTest
260 msx64 debian > Clang.utils/update_cc_test_checks::basic-cplusplus.test
Script: -- : 'RUN: at line 3'; cp /mnt/disks/ssd0/agent/llvm-project/clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp /mnt/disks/ssd0/agent/llvm-project/build/tools/clang/test/utils/update_cc_test_checks/Output/basic-cplusplus.test.tmp.cpp && /usr/bin/python3.8 /mnt/disks/ssd0/agent/llvm-project/build/tools/clang/test/../../../../llvm/utils/update_cc_test_checks.py --clang /mnt/disks/ssd0/agent/llvm-project/build/tools/clang/test/../../../bin/clang --opt /mnt/disks/ssd0/agent/llvm-project/build/tools/clang/test/../../../bin/opt /mnt/disks/ssd0/agent/llvm-project/build/tools/clang/test/utils/update_cc_test_checks/Output/basic-cplusplus.test.tmp.cpp
300 msx64 debian > Clang.utils/update_cc_test_checks::generated-funcs.test
Script: -- : 'RUN: at line 3'; cp /mnt/disks/ssd0/agent/llvm-project/clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c /mnt/disks/ssd0/agent/llvm-project/build/tools/clang/test/utils/update_cc_test_checks/Output/generated-funcs.test.tmp-generated.c && /usr/bin/python3.8 /mnt/disks/ssd0/agent/llvm-project/build/tools/clang/test/../../../../llvm/utils/update_cc_test_checks.py --clang /mnt/disks/ssd0/agent/llvm-project/build/tools/clang/test/../../../bin/clang --opt /mnt/disks/ssd0/agent/llvm-project/build/tools/clang/test/../../../bin/opt --include-generated-funcs /mnt/disks/ssd0/agent/llvm-project/build/tools/clang/test/utils/update_cc_test_checks/Output/generated-funcs.test.tmp-generated.c
680 msx64 debian > Clang.utils/update_cc_test_checks::mangled_names.test
Script: -- : 'RUN: at line 3'; cp -f /mnt/disks/ssd0/agent/llvm-project/clang/test/utils/update_cc_test_checks/Inputs/mangled_names.c /mnt/disks/ssd0/agent/llvm-project/build/tools/clang/test/utils/update_cc_test_checks/Output/mangled_names.test.tmp.c && /usr/bin/python3.8 /mnt/disks/ssd0/agent/llvm-project/build/tools/clang/test/../../../../llvm/utils/update_cc_test_checks.py --clang /mnt/disks/ssd0/agent/llvm-project/build/tools/clang/test/../../../bin/clang --opt /mnt/disks/ssd0/agent/llvm-project/build/tools/clang/test/../../../bin/opt -v /mnt/disks/ssd0/agent/llvm-project/build/tools/clang/test/utils/update_cc_test_checks/Output/mangled_names.test.tmp.c
550 msx64 windows > Clang.utils/update_cc_test_checks::basic-cplusplus.test
Script: -- : 'RUN: at line 3'; cp C:\ws\w16n2-1\llvm-project\premerge-checks\clang\test\utils\update_cc_test_checks/Inputs/basic-cplusplus.cpp C:\ws\w16n2-1\llvm-project\premerge-checks\build\tools\clang\test\utils\update_cc_test_checks\Output\basic-cplusplus.test.tmp.cpp && C:/Python38/python.exe 'c:\ws\w16n2-1\llvm-project\premerge-checks\build\tools\clang\test\..\..\..\..\llvm\utils\update_cc_test_checks.py' --clang 'c:\ws\w16n2-1\llvm-project\premerge-checks\build\tools\clang\test\..\..\..\bin\clang' --opt 'c:\ws\w16n2-1\llvm-project\premerge-checks\build\tools\clang\test\..\..\..\bin\opt' C:\ws\w16n2-1\llvm-project\premerge-checks\build\tools\clang\test\utils\update_cc_test_checks\Output\basic-cplusplus.test.tmp.cpp
610 msx64 windows > Clang.utils/update_cc_test_checks::generated-funcs.test
Script: -- : 'RUN: at line 3'; cp C:\ws\w16n2-1\llvm-project\premerge-checks\clang\test\utils\update_cc_test_checks/Inputs/generated-funcs.c C:\ws\w16n2-1\llvm-project\premerge-checks\build\tools\clang\test\utils\update_cc_test_checks\Output\generated-funcs.test.tmp-generated.c && C:/Python38/python.exe 'c:\ws\w16n2-1\llvm-project\premerge-checks\build\tools\clang\test\..\..\..\..\llvm\utils\update_cc_test_checks.py' --clang 'c:\ws\w16n2-1\llvm-project\premerge-checks\build\tools\clang\test\..\..\..\bin\clang' --opt 'c:\ws\w16n2-1\llvm-project\premerge-checks\build\tools\clang\test\..\..\..\bin\opt' --include-generated-funcs C:\ws\w16n2-1\llvm-project\premerge-checks\build\tools\clang\test\utils\update_cc_test_checks\Output\generated-funcs.test.tmp-generated.c
View Full Test Results (6 Failed)

Event Timeline

jdoerfert created this revision.Jan 14 2021, 7:20 PM
jdoerfert requested review of this revision.Jan 14 2021, 7:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 14 2021, 7:20 PM
mtrofin added inline comments.Mon, Feb 8, 7:04 AM
llvm/utils/UpdateTestChecks/common.py
374–375

nit: could you run a linter to split, insomuch as possible, long lines? I (think I) know we don't enforce a code style of .py, but I'd argue there's readability value in doing it. (no need to scroll right, less eye movement effort)

jdoerfert added inline comments.Tue, Feb 9, 4:04 PM
llvm/utils/UpdateTestChecks/common.py
374–375

I can, but FWIW, this isn't a complete patch yet. It does fix issues we have right now when global values, like #1 or !4, appear in a function but there was an issue with this when I run it on the Attributor tests.

And there are no tests :(

Unsure when I get the time to revisit this, anyone that thinks this is useful, pick up what you want.

kuter added a subscriber: kuter.Sun, Feb 28, 6:33 PM

dict.keys() gives a dict_keys object which isn't a list. [:] doesn't work on it.

llvm/utils/UpdateTestChecks/common.py
601
739
jdoerfert updated this revision to Diff 327988.Wed, Mar 3, 7:13 PM

Added tests, fixed issues, works with all attributor tests

jdoerfert retitled this revision from [Utils][WIP] Check for more global information in update_test_checks to [Utils] Check for more global information in update_test_checks.Wed, Mar 3, 7:14 PM
jdoerfert edited the summary of this revision. (Show Details)
jdoerfert marked 3 inline comments as done.
jdoerfert added inline comments.
llvm/utils/UpdateTestChecks/common.py
374–375

If we define a linter I can run it. For now I broke a few long lines.

This revision is now accepted and ready to land.Wed, Mar 3, 11:12 PM