Don't use simple single word strings for matching as they can
match a substring in the path and give erroneous results.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
llvm/test/tools/llvm-objcopy/ELF/regex.test | ||
---|---|---|
55 ↗ | (On Diff #193410) | Nit: I know this was there before, but would you mind indenting this match, so that it lines up with the other patterns, please? #REGEX2-NOT: Name: foobaz #REGEX2: Name: bar #REGEX2-NOT: Name: rebar |
llvm/test/tools/llvm-symbolizer/ignore-undefined-symbols.s | ||
3 ↗ | (On Diff #193410) | Is implicit-check-not a regex pattern or just a literal check (I think it's a literal check)? Does this still fail when bar appears instead of foo? |
llvm/test/tools/llvm-symbolizer/ignore-undefined-symbols.s | ||
---|---|---|
3 ↗ | (On Diff #193410) | Yes, you're correct, it's a literal check. I can reproduce by using my login -- which obviously isn't a symbol: $ bin/llvm-symbolizer --obj=x.o 0 | bin/FileCheck /Users/dhinton/projects/llvm_project/monorepo/llvm-project/llvm/test/tools/llvm-symbolizer/ignore-undefined-symbols.s --implicit-check-not=dhinton command line:1:22: error: CHECK-NOT: excluded string found in input -implicit-check-not='dhinton' ^ <stdin>:2:8: note: found here /Users/dhinton/projects/llvm_project/monorepo/build/Debug/../../llvm-project/llvm/test/tools/llvm-symbolizer/ignore-undefined-symbols.s:12:0 ^~~~~~~ I'll see if I can come up with a better solution. |
llvm/test/tools/llvm-symbolizer/ignore-undefined-symbols.s | ||
---|---|---|
3 ↗ | (On Diff #193410) | Okay, prepending {{.*}} to ignore-undefined-symbols below fixes the problem. Will update shortly. Thanks for the feedback. |
llvm/test/tools/llvm-symbolizer/ignore-undefined-symbols.s | ||
---|---|---|
3 ↗ | (On Diff #193410) | You may be able to use --implicit-check-not={{^}}bar{{$}}. I haven't tested that though. |
3 ↗ | (On Diff #193410) | I'm not sure I follow how {{.*}} helps fix this? Isn't the problem to do with the use of "foo" without other checks? |
3 ↗ | (On Diff #193410) | "bar", I mean. |
llvm/test/tools/llvm-symbolizer/ignore-undefined-symbols.s | ||
---|---|---|
3 ↗ | (On Diff #193410) | This works as well. Would you prefer this change? |
llvm/test/tools/llvm-objcopy/ELF/regex.test | ||
---|---|---|
50 ↗ | (On Diff #193537) | These tests fails because the match is embedded in the filename depending on the username. So you can skip the filename by searching for "Symbols [", since FileCheck checks for things in order. e.g. # REGEX1: Symbols [ # REGEX1-NOT: Name: foobaz # REGEX1-NOT: Name: bar # REGEX1-NOT: Name: rebar ... (It should even work without the Name: part, but it's clearer to leave that in) |
llvm/test/tools/llvm-symbolizer/ignore-undefined-symbols.s | ||
---|---|---|
3 ↗ | (On Diff #193410) | For reference, I figured out what the issue was, so I'm going to clarify it for any future readers. The full text of the ignore-undefined-symbols.s:12:0 line is an absolute path, IIRC, so could be "/foo/bar/ignore-undefined-symbol.s:12:0". By adding {{.*}} to the pattern, the positive match includes everything on the line. CHECK-NOT (and therefore --implicit-check-not) only matches against things not matched by other CHECKs, so this avoids the issue. |