Changeset View
Standalone View
llvm/test/tools/llvm-symbolizer/ignore-undefined-symbols.s
# REQUIRES: x86-registered-target | # REQUIRES: x86-registered-target | ||||
# RUN: llvm-mc --filetype=obj --triple=x86_64-pc-linux %s -o %t.o -g | # RUN: llvm-mc --filetype=obj --triple=x86_64-pc-linux %s -o %t.o -g | ||||
# RUN: llvm-symbolizer --obj=%t.o 0 | FileCheck %s --implicit-check-not=bar | # RUN: llvm-symbolizer --obj=%t.o 0 | FileCheck %s --implicit-check-not="^bar$" | ||||
jhenderson: Is implicit-check-not a regex pattern or just a literal check (I think it's a literal check)? | |||||
hintondaAuthorUnsubmitted 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. hintonda: Yes, you're correct, it's a literal check. I can reproduce by using my login -- which… | |||||
jhendersonUnsubmitted Not Done ReplyInline ActionsYou may be able to use --implicit-check-not={{^}}bar{{$}}. I haven't tested that though. jhenderson: You may be able to use `--implicit-check-not={{^}}bar{{$}}`. I haven't tested that though. | |||||
hintondaAuthorUnsubmitted This works as well. Would you prefer this change? hintonda: This works as well. Would you prefer this change? | |||||
hintondaAuthorUnsubmitted Okay, prepending {{.*}} to ignore-undefined-symbols below fixes the problem. Will update shortly. Thanks for the feedback. hintonda: Okay, prepending `{{.*}}` to `ignore-undefined-symbols` below fixes the problem. Will update… | |||||
jhendersonUnsubmitted Not Done ReplyInline ActionsI'm not sure I follow how {{.*}} helps fix this? Isn't the problem to do with the use of "foo" without other checks? jhenderson: I'm not sure I follow how {{.*}} helps fix this? Isn't the problem to do with the use of "foo"… | |||||
jhendersonUnsubmitted Not Done ReplyInline Actions"bar", I mean. jhenderson: "bar", I mean. | |||||
jhendersonUnsubmitted Not Done ReplyInline ActionsFor 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. jhenderson: For reference, I figured out what the issue was, so I'm going to clarify it for any future… | |||||
# CHECK: foo | # CHECK: foo | ||||
# CHECK-NEXT: ignore-undefined-symbols.s:12:0 | # CHECK-NEXT: ignore-undefined-symbols.s:12:0 | ||||
.type bar,@function | .type bar,@function | ||||
.type foo,@function | .type foo,@function | ||||
.global foo | .global foo | ||||
foo: | foo: | ||||
call bar | call bar |
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?