Page MenuHomePhabricator

FileCheck [12/12]: Support use of var defined on same line
Needs ReviewPublic

Authored by thopre on Apr 7 2019, 4:24 PM.

Details

Summary

This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch adds support for using a
numeric variable with empty numeric expression defined on the same line
either directly or indirectly.

The regex language used to represent a constraint corresponding to a
given CHECK directive does not allow to express a numeric relation. It
is therefore necessary to initially match any number in the appropriate
matching format and check the constraints are verified in a follow-up
step. Such a process must then be repeated as long as the constraints
fail because of cases with a check directive like #N: #N+1
where the input contains lines such as:
10 12
10 11

The first line would match the regex "[0-9]+ [0-9]+" generated for the
CHECK directive but the constraint would fail. The second line would
then need to be tried since it both matches successfully and verifies
the constraints of the CHECK directive. Note that this process would
still fail to match if the input was:
10 12 13
because the regex would match 10 and 12 which fail to verify the
constraints and the process would then skip to the next line since there
is no way to ask the regex engine if the line had other possible
matches. This caveat is documented.

Copyright:

  • Linaro (changes up to diff 183612 of revision D55940)
  • GraphCore (changes in later versions of revision D55940 and in new revision created off D55940)

Event Timeline

thopre created this revision.Apr 7 2019, 4:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2019, 4:24 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
thopre updated this revision to Diff 194323.Apr 9 2019, 7:35 AM

Use camel casing for new functions

thopre updated this revision to Diff 194488.Apr 10 2019, 4:45 AM

Make numeric value constructor explicit

tra removed a subscriber: tra.Apr 11 2019, 1:16 PM
thopre updated this revision to Diff 197124.Apr 29 2019, 8:42 AM

Rebase on latest changes

thopre updated this revision to Diff 198039.May 3 2019, 9:50 AM

Rebase on latest changes

thopre updated this revision to Diff 198101.May 3 2019, 3:03 PM

Rebase on latest unittest changes

thopre updated this revision to Diff 198448.May 7 2019, 5:36 AM

Rebase on top of latest changes

thopre updated this revision to Diff 198554.May 7 2019, 3:32 PM

Rebase on top of latest changes

thopre updated this revision to Diff 198650.May 8 2019, 6:54 AM

Rebase on top of latest changes

thopre updated this revision to Diff 198955.May 9 2019, 4:56 PM

Rebase on top of latest changes

thopre updated this revision to Diff 199143.May 11 2019, 7:18 AM

Rebase on top of latest changes

thopre updated this revision to Diff 199241.May 13 2019, 3:59 AM

Rebase on top of latest changes

thopre updated this revision to Diff 199401.May 14 2019, 4:08 AM

Rebase on top of latest changes

rnk removed a reviewer: rnk.May 14 2019, 11:28 AM
thopre updated this revision to Diff 200478.May 21 2019, 5:56 AM

rebase on top of latest changes

thopre updated this revision to Diff 200555.May 21 2019, 11:15 AM

rebase on top of latest changes

thopre updated this revision to Diff 201987.May 29 2019, 10:53 AM

Rebase on top of latest changes in patch series

thopre updated this revision to Diff 203214.Jun 5 2019, 11:22 AM

Rebase on top of latest changes in the series

thopre updated this revision to Diff 205685.Jun 19 2019, 3:23 PM

Rebase on top of latest changes in patch series