History log of /llvm-project/llvm/lib/FileCheck/FileCheck.cpp (Results 26 – 50 of 54)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 547e40a9 14-Dec-2022 Douglas Yung <douglas.yung@sony.com>

Revert "[FileCheck] llvm::Optional => std::optional"

This reverts commit 13fd37c931c26ec07613dcad67b5ab2a593cd416.

This change is causing bot failures on some Windows and older GCC bots:
- https://

Revert "[FileCheck] llvm::Optional => std::optional"

This reverts commit 13fd37c931c26ec07613dcad67b5ab2a593cd416.

This change is causing bot failures on some Windows and older GCC bots:
- https://lab.llvm.org/buildbot/#/builders/123/builds/14678
- https://lab.llvm.org/buildbot/#/builders/216/builds/14436
- https://lab.llvm.org/staging/#/builders/235/builds/993

show more ...


# 13fd37c9 14-Dec-2022 Fangrui Song <i@maskray.me>

[FileCheck] llvm::Optional => std::optional


# 93b1ec36 10-Dec-2022 Kazu Hirata <kazu@google.com>

Revert "[FileCheck] Use std::optional in FileCheck.cpp (NFC)"

This reverts commit f555ec57cc01181ce09c802194b6f572f7a3f78a.

One build failure has been reported:

https://lab.llvm.org/buildbot/#/bui

Revert "[FileCheck] Use std::optional in FileCheck.cpp (NFC)"

This reverts commit f555ec57cc01181ce09c802194b6f572f7a3f78a.

One build failure has been reported:

https://lab.llvm.org/buildbot/#/builders/67/builds/9785/steps/6/logs/stdio

show more ...


# f555ec57 10-Dec-2022 Kazu Hirata <kazu@google.com>

[FileCheck] Use std::optional in FileCheck.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-get

[FileCheck] Use std::optional in FileCheck.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

show more ...


# 3dfacc0a 05-Dec-2022 Fangrui Song <i@maskray.me>

CheckedArithmetic: llvm::Optional => std::optional


# aadaafac 03-Dec-2022 Kazu Hirata <kazu@google.com>

[llvm] Use std::nullopt instead of None (NFC)

This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount of ma

[llvm] Use std::nullopt instead of None (NFC)

This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

show more ...


Revision tags: llvmorg-15.0.6
# 01fc2b85 27-Nov-2022 Kazu Hirata <kazu@google.com>

Revert "[FileCheck] Use std::optional in FileCheck.cpp (NFC)"

This reverts commit e5a1ee531b2d325b0c793f849abbbbd4c9d315fd.

Build errors have been reported:

https://lab.llvm.org/buildbot/#/builder

Revert "[FileCheck] Use std::optional in FileCheck.cpp (NFC)"

This reverts commit e5a1ee531b2d325b0c793f849abbbbd4c9d315fd.

Build errors have been reported:

https://lab.llvm.org/buildbot/#/builders/123/builds/14344
https://lab.llvm.org/buildbot#builders/216/builds/13360

show more ...


# e5a1ee53 26-Nov-2022 Kazu Hirata <kazu@google.com>

[FileCheck] Use std::optional in FileCheck.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-get

[FileCheck] Use std::optional in FileCheck.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

show more ...


Revision tags: llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init
# 3a35bcef 21-Jul-2022 David Spickett <david.spickett@linaro.org>

[llvm][FileCheck] Fix unit tests failures with EXPENSIVE_CHECKS

EXPENSIVE_CHECKS enables _GLIBCXX_DEBUG, which makes std::sort
check that the compare function is implemented correctly.

To do this i

[llvm][FileCheck] Fix unit tests failures with EXPENSIVE_CHECKS

EXPENSIVE_CHECKS enables _GLIBCXX_DEBUG, which makes std::sort
check that the compare function is implemented correctly.

To do this it calls it with the first item as both sides.
Which trips the assert here because we think they're
2 capture ranges that overlap, when it's just the same range twice.

Check up front for the two sides being the same item
(same address, not just ==).

Reviewed By: kazu

Differential Revision: https://reviews.llvm.org/D130282

show more ...


Revision tags: llvmorg-14.0.6, llvmorg-14.0.5
# ad1d60c3 26-May-2022 Ivan Kosarev <ivan.kosarev@amd.com>

[FileCheck] Catch missspelled directives.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D125604


Revision tags: llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2
# 821dd3b0 12-Jan-2022 Jay Foad <jay.foad@amd.com>

[FileCheck] Allow literal '['s before "[[var...]]"

Change FileCheck to accept patterns like "[[[var...]]" and treat the
excess open brackets at the start as literals.

This makes the patterns for ma

[FileCheck] Allow literal '['s before "[[var...]]"

Change FileCheck to accept patterns like "[[[var...]]" and treat the
excess open brackets at the start as literals.

This makes the patterns for matching assembler output with literal
brackets much cleaner. For example an AMDGPU pattern that used to be
written like:

buffer_store_dwordx2 v{{\[}}[[LO]]:[[HI]]{{\]}}

can now be:

buffer_store_dwordx2 v[[[LO]]:[[HI]]]

(Even before this patch the final close bracket did not need to be
wrapped in {{}}, but people tended to do it anyway for symmetry.)

This does not introduce any ambiguity since "[[" was always followed by
an identifier or '@' or '#', so "[[[" was always an error.

I've included a few test updates in this patch just for illustration and
testing. There are a couple of hundred tests that could be updated as a
follow up, mostly in test/CodeGen/.

Differential Revision: https://reviews.llvm.org/D117117

Change-Id: Ia6bc6f65cb69734821c911f54a43fe1c673bcca7

show more ...


# 2aed0813 07-Jan-2022 Kazu Hirata <kazu@google.com>

[llvm] Use true/false instead of 1/0 (NFC)

Identified with modernize-use-bool-literals.


Revision tags: llvmorg-13.0.1-rc1
# d14d7068 23-Oct-2021 Kazu Hirata <kazu@google.com>

[llvm] Use StringRef::contains (NFC)


Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3
# a3d357e5 01-Sep-2021 Florian Hahn <flo@fhahn.com>

[FileCheck] Use StringRef for MatchRegexp to fix crash.

If MatchRegexp is an invalid regex, an error message will be printed
using SourceManager::PrintMessage via AddRegExToRegEx.

PrintMessage reli

[FileCheck] Use StringRef for MatchRegexp to fix crash.

If MatchRegexp is an invalid regex, an error message will be printed
using SourceManager::PrintMessage via AddRegExToRegEx.

PrintMessage relies on the input being a StringRef into a string managed
by SourceManager. At the moment, a StringRef to a std::string
allocated in the caller of AddRegExToRegEx is passed. If the regex is
invalid, this StringRef is passed to PrintMessage, where it will crash,
because it does not point to a string managed via SourceMgr.

This patch fixes the crash by turning MatchRegexp into a StringRef If
we use MatchStr, we directly use that StringRef, which points into a
string from SourceMgr. Otherwise, MatchRegexp gets assigned
Format.getWildcardRegex(), which returns a std::string. To extend the
lifetime, assign it to a std::string variable WildcardRegexp and assign
MatchRegexp to a stringref to WildcardRegexp. WildcardRegexp should
always be valid, so we should never have to print an error message
via the SoureMgr I think.

Fixes PR49319.

Reviewed By: thopre

Differential Revision: https://reviews.llvm.org/D109050

show more ...


Revision tags: llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3
# 42f74e82 23-Jun-2021 Martin Storsjö <martin@martin.st>

[llvm] Rename StringRef _lower() method calls to _insensitive()

This is a mechanical change. This actually also renames the
similarly named methods in the SmallString class, however these
methods do

[llvm] Rename StringRef _lower() method calls to _insensitive()

This is a mechanical change. This actually also renames the
similarly named methods in the SmallString class, however these
methods don't seem to be used outside of the llvm subproject, so
this doesn't break building of the rest of the monorepo.

show more ...


Revision tags: llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3
# fd941036 28-Aug-2020 Thomas Preud'homme <thomasp@graphcore.ai>

Fix PR46880: Fail CHECK-NOT with undefined variable

Currently a CHECK-NOT directive succeeds whenever the corresponding
match fails. However match can fail due to an error rather than a lack
of matc

Fix PR46880: Fail CHECK-NOT with undefined variable

Currently a CHECK-NOT directive succeeds whenever the corresponding
match fails. However match can fail due to an error rather than a lack
of match, for instance if a variable is undefined. This commit makes match
error a failure for CHECK-NOT.

Reviewed By: jdenny

Differential Revision: https://reviews.llvm.org/D86222

show more ...


# 058455ff 16-Mar-2021 Thomas Preud'homme <thomasp@graphcore.ai>

[FileCheck] Fix PR49531: invalid use of string var

FileCheck string substitution block parsing code only report an invalid
variable name in a string variable use if it starts with a forbidden
charac

[FileCheck] Fix PR49531: invalid use of string var

FileCheck string substitution block parsing code only report an invalid
variable name in a string variable use if it starts with a forbidden
character. It does not report anything if there are unparsed characters
after the variable name, i.e. [[X-Y]] is parsed as [[X]] and no error is
returned. This commit fixes that.

Reviewed By: jdenny, jhenderson

Differential Revision: https://reviews.llvm.org/D98691

show more ...


# f87b4109 17-Mar-2021 Joel E. Denny <jdenny.ornl@gmail.com>

[FileCheck] Fix redundant diagnostics due to numeric errors

Fixed substitution printing not to produce an empty diagnostic for
errors handled elsewhere.

Reviewed By: thopre

Differential Revision:

[FileCheck] Fix redundant diagnostics due to numeric errors

Fixed substitution printing not to produce an empty diagnostic for
errors handled elsewhere.

Reviewed By: thopre

Differential Revision: https://reviews.llvm.org/D98088

show more ...


# dd59c132 17-Mar-2021 Joel E. Denny <jdenny.ornl@gmail.com>

[FileCheck] Fix numeric error propagation

A more general name might be match-time error propagation. That is,
it's conceivable we'll one day have non-numeric errors that require
the handling fixed

[FileCheck] Fix numeric error propagation

A more general name might be match-time error propagation. That is,
it's conceivable we'll one day have non-numeric errors that require
the handling fixed by this patch.

Without this patch, FileCheck behaves as follows:

```
$ cat check
CHECK-NOT: [[#0x8000000000000000+0x8000000000000000]]

$ FileCheck -vv -dump-input=never check < input
check:1:54: remark: implicit EOF: expected string found in input
CHECK-NOT: [[#0x8000000000000000+0x8000000000000000]]
^
<stdin>:2:1: note: found here

^
check:1:15: error: unable to substitute variable or numeric expression: overflow error
CHECK-NOT: [[#0x8000000000000000+0x8000000000000000]]
^
$ echo $?
0
```

Notice that the exit status is 0 even though there's an error.
Moreover, FileCheck doesn't print the error diagnostic unless both
`-dump-input=never` and `-vv` are specified.

The same problem occurs when `CHECK-NOT` does have a match but a
capture fails due to overflow: exit status is 0, and no diagnostic is
printed unless both `-dump-input=never` and `-vv` are specified. The
usefulness of capturing from `CHECK-NOT` is questionable, but this
case should certainly produce an error.

With this patch, FileCheck always includes the error diagnostic and
has non-zero exit status for the above examples. It's conceivable
that this change will cause some existing tests to fail, but my
assumption is that they should fail. Moreover, with nearly every
project enabled, this patch didn't produce additional `check-all`
failures for me.

This patch also extends input dumps to include such numeric error
diagnostics for both expected and excluded patterns.

As noted in fixmes in some of the tests added by this patch, this
patch worsens an existing issue with redundant diagnostics. I'll fix
that bug in a subsequent patch.

Reviewed By: thopre, jhenderson

Differential Revision: https://reviews.llvm.org/D98086

show more ...


Revision tags: llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2
# f9e2a62c 11-Jun-2020 Thomas Preud'homme <thomasp@graphcore.ai>

[FileCheck] Add support for hex alternate form in FileCheck

Add printf-style alternate form flag to prefix hex number with 0x when
present. This works on both empty numeric expression (e.g. variable

[FileCheck] Add support for hex alternate form in FileCheck

Add printf-style alternate form flag to prefix hex number with 0x when
present. This works on both empty numeric expression (e.g. variable
definition from input) and when matching a numeric expression. The
syntax is as follows:

[[#%#<precision specifier><format specifier>, ...]

where <precision specifier> and <format specifier> are optional and ...
can be a variable definition or not with an empty expression or not.

This feature was requested in https://reviews.llvm.org/D81144#2075532
for llvm/test/MC/ELF/gen-dwarf64.s

Reviewed By: jdenny

Differential Revision: https://reviews.llvm.org/D97845

show more ...


# c347619b 10-Mar-2021 Thomas Preud'homme <thomasp@graphcore.ai>

[FileCheck] Fix naming of OverflowErrorStr var

As pointed out by Joel E. Denny in D97845, the OverflowErrorStr variable
is misnamed because the error is raised for any parsing error. Note that
in Fi

[FileCheck] Fix naming of OverflowErrorStr var

As pointed out by Joel E. Denny in D97845, the OverflowErrorStr variable
is misnamed because the error is raised for any parsing error. Note that
in FileCheck proper this only happens in case of (under|over)flow
because the regex will ensure a number in the correct format is matched.

Reviewed By: jdenny

Differential Revision: https://reviews.llvm.org/D98342

show more ...


# 09c35739 15-Dec-2020 Thomas Preud'homme <thomasp@graphcore.ai>

[FileCheck] Do not skip end of line in diagnostics

When commit da108b4ed4e6e7267701e76d5fd3b87609c9ab77 introduced
the CHECK-NEXT directive, it added logic to skip to the next line when
printing a d

[FileCheck] Do not skip end of line in diagnostics

When commit da108b4ed4e6e7267701e76d5fd3b87609c9ab77 introduced
the CHECK-NEXT directive, it added logic to skip to the next line when
printing a diagnostic if the current matching position is at the end of
a line. This was fine while FileCheck did not support regular expression
but since it does now it can be confusing when the pattern to match
starts with the expectation of a newline (e.g. CHECK-NEXT: {{\n}}foo).
It is also inconsistent with the column information in the diagnostic
which does point to the end of line.

This commit removes this logic altogether, such that failure to match
diagnostic for such cases would show the end of line and be consistent
with the column information. The commit also adapts all existing
testcases accordingly.

Note to reviewers: An alternative approach would be to restrict the code
to only skip to the next line if the first character of the pattern is
known not to match a whitespace-like character. This would respect the
original intent but keep the inconsistency in terms of column info and
requires more code. I've only chosen this current approach by laziness
and would be happy to restrict the logic instead.

Reviewed By: jdenny, jhenderson

Differential Revision: https://reviews.llvm.org/D93341

show more ...


# 352fcfc6 17-Jan-2021 Kazu Hirata <kazu@google.com>

[llvm] Use llvm::sort (NFC)


# 7dc3575e 15-Jan-2021 Kazu Hirata <kazu@google.com>

[llvm] Remove redundant return and continue statements (NFC)

Identified with readability-redundant-control-flow.


# 44f399cc 19-Dec-2020 Jacques Pienaar <jpienaar@google.com>

[FileCheck] Add a literal check directive modifier

Introduce CHECK modifiers that change the behavior of the CHECK
directive. Also add a LITERAL modifier for cases where matching could
end requiring

[FileCheck] Add a literal check directive modifier

Introduce CHECK modifiers that change the behavior of the CHECK
directive. Also add a LITERAL modifier for cases where matching could
end requiring escaping strings interpreted as regex where only
literal/fixed string matching is desired (making the CHECK's more
difficult to write/fragile and difficult to interpret).

show more ...


123