[PATCH] D77876: Normalize working directory when running llvm-mc

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 14 10:44:07 PDT 2020


MaskRay added a comment.

In D77876#1979801 <https://reviews.llvm.org/D77876#1979801>, @serge-sans-paille wrote:

> In D77876#1978452 <https://reviews.llvm.org/D77876#1978452>, @MaskRay wrote:
>
> > > Otherwise, depending on the lit location used to run the test, llvm-mc adds an include_directories entry in the dwarf output, which breaks tests in some setup.
> >
> > Do you know under what exact condition this happens? We need it for a better test comment...
>
>
> yes, I can provide the full setup, basically:
>
> 1. run the testsuite to have all the.script file generated: `lit -sv ${llvmproject_srcdir}/_build/test/MC/MachO --filter gen-dwarf.s`
> 2. go to test directory, for hacking: `cd ${llvmproject_dir}/llvm/test/MC/MachO`
> 3. run the .script file by hand from that directory: `sh ${llvmproject_srcdir}/_build/test/MC/MachO/Output/gen-dwarf.s.script`


Thanks for sharing the setup! If the directory name of gen-dwarf.s is the same as the current working directory (DW_AT_comp_dir), dir_index is 0, otherwise dir_index is 1. MCDwarf.cpp's behavior is consistent with GNU as -g here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77876





More information about the llvm-commits mailing list