mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-09 13:33:17 +00:00
Cleanup docs about lit substitutions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201464 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0877c6575a
commit
4b3ec1763c
@ -337,69 +337,90 @@ triple, test with the specific FileCheck and put it into the specific
|
|||||||
directory that will filter out all other architectures.
|
directory that will filter out all other architectures.
|
||||||
|
|
||||||
|
|
||||||
Variables and substitutions
|
Substitutions
|
||||||
---------------------------
|
-------------
|
||||||
|
|
||||||
With a RUN line there are a number of substitutions that are permitted.
|
Besides replacing LLVM tool names the following substitutions are performed in
|
||||||
To make a substitution just write the variable's name preceded by a ``$``.
|
RUN lines:
|
||||||
Additionally, for compatibility reasons with previous versions of the
|
|
||||||
test library, certain names can be accessed with an alternate syntax: a
|
|
||||||
% prefix. These alternates are deprecated and may go away in a future
|
|
||||||
version.
|
|
||||||
|
|
||||||
Here are the available variable names. The alternate syntax is listed in
|
``%%``
|
||||||
parentheses.
|
Replaced by a single ``%``. This allows escaping other substitutions.
|
||||||
|
|
||||||
``$test`` (``%s``)
|
``%s``
|
||||||
The full path to the test case's source. This is suitable for passing on
|
File path to the test case's source. This is suitable for passing on the
|
||||||
the command line as the input to an LLVM tool.
|
command line as the input to an LLVM tool.
|
||||||
|
|
||||||
``%(line)``, ``%(line+<number>)``, ``%(line-<number>)``
|
Example: ``/home/user/llvm/test/MC/ELF/foo_test.s``
|
||||||
The number of the line where this variable is used, with an optional
|
|
||||||
integer offset. This can be used in tests with multiple RUN lines,
|
|
||||||
which reference test file's line numbers.
|
|
||||||
|
|
||||||
``$srcdir``
|
``%S``
|
||||||
The source directory from where the ``make check`` was run.
|
Directory path to the test case's source.
|
||||||
|
|
||||||
``objdir``
|
Example: ``/home/user/llvm/test/MC/ELF``
|
||||||
The object directory that corresponds to the ``$srcdir``.
|
|
||||||
|
|
||||||
``subdir``
|
``%t``
|
||||||
A partial path from the ``test`` directory that contains the
|
File path to a temporary file name that could be used for this test case.
|
||||||
sub-directory that contains the test source being executed.
|
|
||||||
|
|
||||||
``srcroot``
|
|
||||||
The root directory of the LLVM src tree.
|
|
||||||
|
|
||||||
``objroot``
|
|
||||||
The root directory of the LLVM object tree. This could be the same as
|
|
||||||
the srcroot.
|
|
||||||
|
|
||||||
``path``
|
|
||||||
The path to the directory that contains the test case source. This is
|
|
||||||
for locating any supporting files that are not generated by the test,
|
|
||||||
but used by the test.
|
|
||||||
|
|
||||||
``tmp``
|
|
||||||
The path to a temporary file name that could be used for this test case.
|
|
||||||
The file name won't conflict with other test cases. You can append to it
|
The file name won't conflict with other test cases. You can append to it
|
||||||
if you need multiple temporaries. This is useful as the destination of
|
if you need multiple temporaries. This is useful as the destination of
|
||||||
some redirected output.
|
some redirected output.
|
||||||
|
|
||||||
``target_triplet`` (``%target_triplet``)
|
Example: ``/home/user/llvm.build/test/MC/ELF/Output/foo_test.s.tmp``
|
||||||
The target triplet that corresponds to the current host machine (the one
|
|
||||||
running the test cases). This should probably be called "host".
|
|
||||||
|
|
||||||
``link`` (``%link``)
|
``%T``
|
||||||
This full link command used to link LLVM executables. This has all the
|
Directory of ``%t``.
|
||||||
configured ``-I``, ``-L`` and ``-l`` options.
|
|
||||||
|
|
||||||
``shlibext`` (``%shlibext``)
|
Example: ``/home/user/llvm.build/test/MC/ELF/Output``
|
||||||
The suffix for the host platforms shared library (DLL) files. This
|
|
||||||
includes the period as the first character.
|
``%{pathsep}``
|
||||||
|
|
||||||
|
Expands to the path separator, i.e. ``:`` (or ``;`` on Windows).
|
||||||
|
|
||||||
|
|
||||||
|
**LLVM-specific substitutions:**
|
||||||
|
|
||||||
|
``%shlibext``
|
||||||
|
The suffix for the host platforms shared library files. This includes the
|
||||||
|
period as the first character.
|
||||||
|
|
||||||
|
Example: ``.so`` (Linux), ``.dylib`` (OS X), ``.dll`` (Windows)
|
||||||
|
|
||||||
|
``%exeext``
|
||||||
|
The suffix for the host platforms executable files. This includes the
|
||||||
|
period as the first character.
|
||||||
|
|
||||||
|
Example: ``.exe`` (Windows), empty on Linux.
|
||||||
|
|
||||||
|
``%(line)``, ``%(line+<number>)``, ``%(line-<number>)``
|
||||||
|
The number of the line where this substitution is used, with an optional
|
||||||
|
integer offset. This can be used in tests with multiple RUN lines, which
|
||||||
|
reference test file's line numbers.
|
||||||
|
|
||||||
|
|
||||||
|
**Clang-specific substitutions:**
|
||||||
|
|
||||||
|
``%clang``
|
||||||
|
Invokes the Clang driver.
|
||||||
|
|
||||||
|
``%clang_cpp``
|
||||||
|
Invokes the Clang driver for C++.
|
||||||
|
|
||||||
|
``%clang_cl``
|
||||||
|
Invokes the CL-compatible Clang driver.
|
||||||
|
|
||||||
|
``%clangxx``
|
||||||
|
Invokes the G++-compatible Clang driver.
|
||||||
|
|
||||||
|
``%clang_cc1``
|
||||||
|
Invokes the Clang frontend.
|
||||||
|
|
||||||
|
``%itanium_abi_triple``, ``%ms_abi_triple``
|
||||||
|
These substitutions can be used to get the current target triple adjusted to
|
||||||
|
the desired ABI. For example, if the test suite is running with the
|
||||||
|
``i686-pc-win32`` target, ``%itanium_abi_triple`` will expand to
|
||||||
|
``i686-pc-mingw32``. This allows a test to run with a specific ABI without
|
||||||
|
constraining it to a specific triple.
|
||||||
|
|
||||||
|
To add more substituations, look at ``test/lit.cfg`` or ``lit.local.cfg``.
|
||||||
|
|
||||||
To add more variables, look at ``test/lit.cfg``.
|
|
||||||
|
|
||||||
Other Features
|
Other Features
|
||||||
--------------
|
--------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user