[llvm-dev] How to make a subdirectory in a lit test?

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 6 15:45:18 PDT 2020


there are some existing tests that seem to do this, for instance:

llvm/test/tools/llvm-ar/lto-kind-from-triple.test

Are these not running on Windows?

On Thu, Aug 6, 2020 at 3:36 PM Adrian McCarthy via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
>
> I'm writing a lit test that needs to temporarily make a subdirectory.
>
> I tried:
>
> ```
> // RUN: mkdir %t/subdir
> ```
>
> But on Windows, it's hard to bypass the built-in mkdir to use a Posix-style one from Git or GnuWin.  The built-in mkdir believes the `/subdir` is an unrecognized command flag.  I figure I cannot just use a backslash because that would fail on Posix systems.  (The test should run on all platforms.)
>
> The lit documentation mentioned a `%{pathsep}` macro, so I tried that.  After several minutes of confusing results, I discovered this is not for the path component separator, but for the separators used between paths in the PATH environment variable.  On Windows, that's ';', which doesn't help.
>
> Suggestions?
>
> Thanks,
> Adrian McCarthy
>
> Why does this test need a separate directory?
>
> The test is to confirm that LLDB can locate a PDB symbol file that corresponds to the target executable.  In the executable, the linker writes the location where it generated the PDB file.  I need that path to be a different directory than the directory for the executable itself because the fallback search includes the directory of the executable.
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list