This is an archive of the discontinued LLVM Phabricator instance.

[UpdateTestChecks] Match 'attributes #' at the end
AbandonedPublic

Authored by sstefan1 on Aug 13 2020, 1:49 PM.

Details

Summary

With this patch we can now add check lines outside of the function.
For now we match only attributes at the end of the module, but other
values can be added later as well.

Haven't actually tried it yet, but adding checks for other values
should be as easy as adding appropriate regexps in nameless_values list.

Diff Detail

Event Timeline

sstefan1 created this revision.Aug 13 2020, 1:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 13 2020, 1:49 PM
sstefan1 requested review of this revision.Aug 13 2020, 1:49 PM
sstefan1 added inline comments.Aug 13 2020, 1:51 PM
llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/check_attrs.ll.funcattrs.expected
30

I need to work a little bit more on files that have multiple check lines, but the general approach should remain the same (if everyone agrees).

sstefan1 updated this revision to Diff 285649.Aug 14 2020, 7:15 AM

actually make it work when multiple check prefixes are provided

Cool, some initial comments below :)

llvm/utils/UpdateTestChecks/common.py
328

Nit: Align the columns. Maybe reorder so we have prefix and then regexp, we can then also make those a pair: ('r'%', r'...'), (...)

557

do we need to ensure this is a full line match? r'^' + ... + '$' or something?

562

we can do this once further out.

575

Can you explain the above conditionals in a comment?

This is cool!

sstefan1 updated this revision to Diff 286134.Aug 17 2020, 1:42 PM

addressing comments

llvm/utils/UpdateTestChecks/common.py
328

I am not sure I see a place where those could be used separately. Am I missing something?

jdoerfert added inline comments.Aug 17 2020, 5:32 PM
llvm/utils/UpdateTestChecks/common.py
328

I mean, it's easier to read the thing if the "local" prefixes are in a pair and then the global ones are. But it's just an idea, unclear if it's really easier to read at the end of the day.

This revision is now accepted and ready to land.Aug 18 2020, 9:12 AM
sstefan1 updated this revision to Diff 288063.Aug 26 2020, 11:57 AM

Sorry for the delay on this.

The reason I didn't commit this is that I changed the update_test_checks.py to
skip all the CHECK lines, not just the ones inside the function.
With this update, we only skip CHECK lines inside of functions and global ones
that are being added (currently 'CHECK: attributes #...')
Every new global check added should be automatically skiped with this.

sstefan1 updated this revision to Diff 288076.Aug 26 2020, 12:21 PM

Don't skip ;\n comments

sstefan1 abandoned this revision.Sep 22 2020, 7:24 AM

Switched to D88096.