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

Adrian McCarthy via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 6 15:35:58 PDT 2020


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200806/8571c756/attachment.html>


More information about the llvm-dev mailing list