This is an archive of the discontinued LLVM Phabricator instance.

[test, AArch64] Fix use of var defined in CHECK-NOT
ClosedPublic

Authored by thopre on Apr 4 2021, 2:04 PM.

Details

Summary

LLVM test CodeGen/AArch64/speculation-hardening.ll tries to check for
the absence of a sequence of instructions with several CHECK-NOT with
one of those directives using a variable defined in another. However
CHECK-NOT are checked independently so that is using a variable defined
in a pattern that should not occur in the input.

This commit removes the dependency between those CHECK-NOT by replacing
single occurence of the undefined variable by a regex match, and
multiple occurences by a definition followed by a use.

Diff Detail

Event Timeline

thopre created this revision.Apr 4 2021, 2:04 PM
thopre requested review of this revision.Apr 4 2021, 2:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 4 2021, 2:04 PM
aemerson added inline comments.Apr 6 2021, 10:54 AM
llvm/test/CodeGen/AArch64/speculation-hardening.ll
20

What about TMPREG?

thopre marked an inline comment as done.Apr 6 2021, 12:07 PM
thopre added inline comments.
llvm/test/CodeGen/AArch64/speculation-hardening.ll
20

Using a variable defined on the same line works, it gets translated into a regex backreference. TMPREG will never be defined for use in later directive but FileCheck will check that and (x[0-9]+), \1, x16 does not occur.

aemerson accepted this revision.Apr 6 2021, 12:18 PM
This revision is now accepted and ready to land.Apr 6 2021, 12:18 PM
This revision was automatically updated to reflect the committed changes.
thopre marked an inline comment as done.