[PATCH] D100681: llvm-objdump: add --rpaths to macho support

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 21 00:20:29 PDT 2021


jhenderson added inline comments.


================
Comment at: llvm/test/tools/llvm-objdump/MachO/rpaths.test:5
+
+# CHECK: @executable_path/../Frameworks
+
----------------
keith wrote:
> MaskRay wrote:
> > If you want to ensure there is no other string, you can use `FileCheck %s --match-full-lines --strict-whitespace`  or add `{{^}}...{{$}}`
> In this case there's also the header, which I wasn't worried about showing up one way or the other (since I made sure below it still doesn't show up if you pass the flag to disable it)
I think @MaskRay's point was that the current and previous patterns don't detect either of the following two cases:

```
Objc2.64bit.exe.macho-x86_64:
<some other rpath>
@executable_path/../Frameworks
<some other rpath>
```
```
Objc2.64bit.exe.macho-x86_64:
some nonsense @executable_path/../Frameworks garbagegarbage
```
By default, FileCheck looks for substrings anywhere in the output after the previous match, and succeeds if it finds them. It doesn't have to be the whole line, unless you use `--match-full-lines`. `--strict-whitespace` also ensures that the line is appropriately indented (or not) as desired, with no leading or trailing whitespace beyond what is checked-for explicitly on each CHECK line. Meanwhile, CHECK-NEXT and CHECK-EMPTY can be used to ensure the output is on the desired lines in relation to each other.

Finally, if you want to ensure there is no output anywhere other than what you check for explicitly, you could use `--implicit-check-not={{.}}`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100681/new/

https://reviews.llvm.org/D100681



More information about the llvm-commits mailing list