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
- rG LLVM Github Monorepo
- Build Status
Buildable 29984 Build 29983: arc lint + arc unit
Event Timeline
llvm/test/tools/llvm-objcopy/ELF/regex.test | ||
---|---|---|
55 | 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 | 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 | 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 | 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 | This works as well. Would you prefer this change? |
llvm/test/tools/llvm-objcopy/ELF/regex.test | ||
---|---|---|
50–52 | 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 | 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. |
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.
(It should even work without the Name: part, but it's clearer to leave that in)