<div dir="ltr">Awesome! We've needed this for a long time!<div><br></div><div>-- Sean Silva</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Feb 15, 2014 at 3:35 AM, Nico Rieck <span dir="ltr"><<a href="mailto:nico.rieck@gmail.com" target="_blank">nico.rieck@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: nrieck<br>
Date: Sat Feb 15 02:35:56 2014<br>
New Revision: 201464<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=201464&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=201464&view=rev</a><br>
Log:<br>
Cleanup docs about lit substitutions<br>
<br>
Modified:<br>
llvm/trunk/docs/TestingGuide.rst<br>
<br>
Modified: llvm/trunk/docs/TestingGuide.rst<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/TestingGuide.rst?rev=201464&r1=201463&r2=201464&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/TestingGuide.rst?rev=201464&r1=201463&r2=201464&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/docs/TestingGuide.rst (original)<br>
+++ llvm/trunk/docs/TestingGuide.rst Sat Feb 15 02:35:56 2014<br>
@@ -337,69 +337,90 @@ triple, test with the specific FileCheck<br>
directory that will filter out all other architectures.<br>
<br>
<br>
-Variables and substitutions<br>
----------------------------<br>
+Substitutions<br>
+-------------<br>
<br>
-With a RUN line there are a number of substitutions that are permitted.<br>
-To make a substitution just write the variable's name preceded by a ``$``.<br>
-Additionally, for compatibility reasons with previous versions of the<br>
-test library, certain names can be accessed with an alternate syntax: a<br>
-% prefix. These alternates are deprecated and may go away in a future<br>
-version.<br>
-<br>
-Here are the available variable names. The alternate syntax is listed in<br>
-parentheses.<br>
-<br>
-``$test`` (``%s``)<br>
- The full path to the test case's source. This is suitable for passing on<br>
- the command line as the input to an LLVM tool.<br>
+Besides replacing LLVM tool names the following substitutions are performed in<br>
+RUN lines:<br>
<br>
-``%(line)``, ``%(line+<number>)``, ``%(line-<number>)``<br>
- The number of the line where this variable is used, with an optional<br>
- integer offset. This can be used in tests with multiple RUN lines,<br>
- which reference test file's line numbers.<br>
-<br>
-``$srcdir``<br>
- The source directory from where the ``make check`` was run.<br>
-<br>
-``objdir``<br>
- The object directory that corresponds to the ``$srcdir``.<br>
-<br>
-``subdir``<br>
- A partial path from the ``test`` directory that contains the<br>
- sub-directory that contains the test source being executed.<br>
-<br>
-``srcroot``<br>
- The root directory of the LLVM src tree.<br>
-<br>
-``objroot``<br>
- The root directory of the LLVM object tree. This could be the same as<br>
- the srcroot.<br>
-<br>
-``path``<br>
- The path to the directory that contains the test case source. This is<br>
- for locating any supporting files that are not generated by the test,<br>
- but used by the test.<br>
+``%%``<br>
+ Replaced by a single ``%``. This allows escaping other substitutions.<br>
+<br>
+``%s``<br>
+ File path to the test case's source. This is suitable for passing on the<br>
+ command line as the input to an LLVM tool.<br>
+<br>
+ Example: ``/home/user/llvm/test/MC/ELF/foo_test.s``<br>
+<br>
+``%S``<br>
+ Directory path to the test case's source.<br>
<br>
-``tmp``<br>
- The path to a temporary file name that could be used for this test case.<br>
+ Example: ``/home/user/llvm/test/MC/ELF``<br>
+<br>
+``%t``<br>
+ File path to a temporary file name that could be used for this test case.<br>
The file name won't conflict with other test cases. You can append to it<br>
if you need multiple temporaries. This is useful as the destination of<br>
some redirected output.<br>
<br>
-``target_triplet`` (``%target_triplet``)<br>
- The target triplet that corresponds to the current host machine (the one<br>
- running the test cases). This should probably be called "host".<br>
-<br>
-``link`` (``%link``)<br>
- This full link command used to link LLVM executables. This has all the<br>
- configured ``-I``, ``-L`` and ``-l`` options.<br>
-<br>
-``shlibext`` (``%shlibext``)<br>
- The suffix for the host platforms shared library (DLL) files. This<br>
- includes the period as the first character.<br>
+ Example: ``/home/user/llvm.build/test/MC/ELF/Output/foo_test.s.tmp``<br>
+<br>
+``%T``<br>
+ Directory of ``%t``.<br>
+<br>
+ Example: ``/home/user/llvm.build/test/MC/ELF/Output``<br>
+<br>
+``%{pathsep}``<br>
+<br>
+ Expands to the path separator, i.e. ``:`` (or ``;`` on Windows).<br>
+<br>
+<br>
+**LLVM-specific substitutions:**<br>
+<br>
+``%shlibext``<br>
+ The suffix for the host platforms shared library files. This includes the<br>
+ period as the first character.<br>
+<br>
+ Example: ``.so`` (Linux), ``.dylib`` (OS X), ``.dll`` (Windows)<br>
+<br>
+``%exeext``<br>
+ The suffix for the host platforms executable files. This includes the<br>
+ period as the first character.<br>
+<br>
+ Example: ``.exe`` (Windows), empty on Linux.<br>
+<br>
+``%(line)``, ``%(line+<number>)``, ``%(line-<number>)``<br>
+ The number of the line where this substitution is used, with an optional<br>
+ integer offset. This can be used in tests with multiple RUN lines, which<br>
+ reference test file's line numbers.<br>
+<br>
+<br>
+**Clang-specific substitutions:**<br>
+<br>
+``%clang``<br>
+ Invokes the Clang driver.<br>
+<br>
+``%clang_cpp``<br>
+ Invokes the Clang driver for C++.<br>
+<br>
+``%clang_cl``<br>
+ Invokes the CL-compatible Clang driver.<br>
+<br>
+``%clangxx``<br>
+ Invokes the G++-compatible Clang driver.<br>
+<br>
+``%clang_cc1``<br>
+ Invokes the Clang frontend.<br>
+<br>
+``%itanium_abi_triple``, ``%ms_abi_triple``<br>
+ These substitutions can be used to get the current target triple adjusted to<br>
+ the desired ABI. For example, if the test suite is running with the<br>
+ ``i686-pc-win32`` target, ``%itanium_abi_triple`` will expand to<br>
+ ``i686-pc-mingw32``. This allows a test to run with a specific ABI without<br>
+ constraining it to a specific triple.<br>
+<br>
+To add more substituations, look at ``test/lit.cfg`` or ``lit.local.cfg``.<br>
<br>
-To add more variables, look at ``test/lit.cfg``.<br>
<br>
Other Features<br>
--------------<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>