1=================================
2LLVM Testing Infrastructure Guide
3=================================
4
5.. contents::
6   :local:
7
8.. toctree::
9   :hidden:
10
11   TestSuiteGuide
12   TestSuiteMakefileGuide
13
14Overview
15========
16
17This document is the reference manual for the LLVM testing
18infrastructure. It documents the structure of the LLVM testing
19infrastructure, the tools needed to use it, and how to add and run
20tests.
21
22Requirements
23============
24
25In order to use the LLVM testing infrastructure, you will need all of the
26software required to build LLVM, as well as `Python <http://python.org>`_ 3.6 or
27later.
28
29LLVM Testing Infrastructure Organization
30========================================
31
32The LLVM testing infrastructure contains three major categories of tests:
33unit tests, regression tests and whole programs. The unit tests and regression
34tests are contained inside the LLVM repository itself under ``llvm/unittests``
35and ``llvm/test`` respectively and are expected to always pass -- they should be
36run before every commit.
37
38The whole programs tests are referred to as the "LLVM test suite" (or
39"test-suite") and are in the ``test-suite``
40`repository on GitHub <https://github.com/llvm/llvm-test-suite.git>`_.
41For historical reasons, these tests are also referred to as the "nightly
42tests" in places, which is less ambiguous than "test-suite" and remains
43in use although we run them much more often than nightly.
44
45Unit tests
46----------
47
48Unit tests are written using `Google Test <https://github.com/google/googletest/blob/master/docs/primer.md>`_
49and `Google Mock <https://github.com/google/googletest/blob/master/docs/gmock_for_dummies.md>`_
50and are located in the ``llvm/unittests`` directory.
51In general unit tests are reserved for targeting the support library and other
52generic data structure, we prefer relying on regression tests for testing
53transformations and analysis on the IR.
54
55Regression tests
56----------------
57
58The regression tests are small pieces of code that test a specific
59feature of LLVM or trigger a specific bug in LLVM. The language they are
60written in depends on the part of LLVM being tested. These tests are driven by
61the :doc:`Lit <CommandGuide/lit>` testing tool (which is part of LLVM), and
62are located in the ``llvm/test`` directory.
63
64Typically when a bug is found in LLVM, a regression test containing just
65enough code to reproduce the problem should be written and placed
66somewhere underneath this directory. For example, it can be a small
67piece of LLVM IR distilled from an actual application or benchmark.
68
69Testing Analysis
70----------------
71
72An analysis is a pass that infer properties on some part of the IR and not
73transforming it. They are tested in general using the same infrastructure as the
74regression tests, by creating a separate "Printer" pass to consume the analysis
75result and print it on the standard output in a textual format suitable for
76FileCheck.
77See `llvm/test/Analysis/BranchProbabilityInfo/loop.ll <https://github.com/llvm/llvm-project/blob/main/llvm/test/Analysis/BranchProbabilityInfo/loop.ll>`_
78for an example of such test.
79
80``test-suite``
81--------------
82
83The test suite contains whole programs, which are pieces of code which
84can be compiled and linked into a stand-alone program that can be
85executed. These programs are generally written in high level languages
86such as C or C++.
87
88These programs are compiled using a user specified compiler and set of
89flags, and then executed to capture the program output and timing
90information. The output of these programs is compared to a reference
91output to ensure that the program is being compiled correctly.
92
93In addition to compiling and executing programs, whole program tests
94serve as a way of benchmarking LLVM performance, both in terms of the
95efficiency of the programs generated as well as the speed with which
96LLVM compiles, optimizes, and generates code.
97
98The test-suite is located in the ``test-suite``
99`repository on GitHub <https://github.com/llvm/llvm-test-suite.git>`_.
100
101See the :doc:`TestSuiteGuide` for details.
102
103Debugging Information tests
104---------------------------
105
106The test suite contains tests to check quality of debugging information.
107The test are written in C based languages or in LLVM assembly language.
108
109These tests are compiled and run under a debugger. The debugger output
110is checked to validate of debugging information. See README.txt in the
111test suite for more information. This test suite is located in the
112``cross-project-tests/debuginfo-tests`` directory.
113
114Quick start
115===========
116
117The tests are located in two separate repositories. The unit and
118regression tests are in the main "llvm"/ directory under the directories
119``llvm/unittests`` and ``llvm/test`` (so you get these tests for free with the
120main LLVM tree). Use ``make check-all`` to run the unit and regression tests
121after building LLVM.
122
123The ``test-suite`` module contains more comprehensive tests including whole C
124and C++ programs. See the :doc:`TestSuiteGuide` for details.
125
126Unit and Regression tests
127-------------------------
128
129To run all of the LLVM unit tests use the check-llvm-unit target:
130
131.. code-block:: bash
132
133    % make check-llvm-unit
134
135To run all of the LLVM regression tests use the check-llvm target:
136
137.. code-block:: bash
138
139    % make check-llvm
140
141In order to get reasonable testing performance, build LLVM and subprojects
142in release mode, i.e.
143
144.. code-block:: bash
145
146    % cmake -DCMAKE_BUILD_TYPE="Release" -DLLVM_ENABLE_ASSERTIONS=On
147
148If you have `Clang <https://clang.llvm.org/>`_ checked out and built, you
149can run the LLVM and Clang tests simultaneously using:
150
151.. code-block:: bash
152
153    % make check-all
154
155To run the tests with Valgrind (Memcheck by default), use the ``LIT_ARGS`` make
156variable to pass the required options to lit. For example, you can use:
157
158.. code-block:: bash
159
160    % make check LIT_ARGS="-v --vg --vg-leak"
161
162to enable testing with valgrind and with leak checking enabled.
163
164To run individual tests or subsets of tests, you can use the ``llvm-lit``
165script which is built as part of LLVM. For example, to run the
166``Integer/BitPacked.ll`` test by itself you can run:
167
168.. code-block:: bash
169
170    % llvm-lit ~/llvm/test/Integer/BitPacked.ll
171
172or to run all of the ARM CodeGen tests:
173
174.. code-block:: bash
175
176    % llvm-lit ~/llvm/test/CodeGen/ARM
177
178The regression tests will use the Python psutil module only if installed in a
179**non-user** location. Under Linux, install with sudo or within a virtual
180environment. Under Windows, install Python for all users and then run
181``pip install psutil`` in an elevated command prompt.
182
183For more information on using the :program:`lit` tool, see ``llvm-lit --help``
184or the :doc:`lit man page <CommandGuide/lit>`.
185
186Debugging Information tests
187---------------------------
188
189To run debugging information tests simply add the ``cross-project-tests``
190project to your ``LLVM_ENABLE_PROJECTS`` define on the cmake
191command-line.
192
193Regression test structure
194=========================
195
196The LLVM regression tests are driven by :program:`lit` and are located in the
197``llvm/test`` directory.
198
199This directory contains a large array of small tests that exercise
200various features of LLVM and to ensure that regressions do not occur.
201The directory is broken into several sub-directories, each focused on a
202particular area of LLVM.
203
204Writing new regression tests
205----------------------------
206
207The regression test structure is very simple, but does require some
208information to be set. This information is gathered via ``cmake``
209and is written to a file, ``test/lit.site.cfg`` in the build directory.
210The ``llvm/test`` Makefile does this work for you.
211
212In order for the regression tests to work, each directory of tests must
213have a ``lit.local.cfg`` file. :program:`lit` looks for this file to determine
214how to run the tests. This file is just Python code and thus is very
215flexible, but we've standardized it for the LLVM regression tests. If
216you're adding a directory of tests, just copy ``lit.local.cfg`` from
217another directory to get running. The standard ``lit.local.cfg`` simply
218specifies which files to look in for tests. Any directory that contains
219only directories does not need the ``lit.local.cfg`` file. Read the :doc:`Lit
220documentation <CommandGuide/lit>` for more information.
221
222Each test file must contain lines starting with "RUN:" that tell :program:`lit`
223how to run it. If there are no RUN lines, :program:`lit` will issue an error
224while running a test.
225
226RUN lines are specified in the comments of the test program using the
227keyword ``RUN`` followed by a colon, and lastly the command (pipeline)
228to execute. Together, these lines form the "script" that :program:`lit`
229executes to run the test case. The syntax of the RUN lines is similar to a
230shell's syntax for pipelines including I/O redirection and variable
231substitution. However, even though these lines may *look* like a shell
232script, they are not. RUN lines are interpreted by :program:`lit`.
233Consequently, the syntax differs from shell in a few ways. You can specify
234as many RUN lines as needed.
235
236:program:`lit` performs substitution on each RUN line to replace LLVM tool names
237with the full paths to the executable built for each tool (in
238``$(LLVM_OBJ_ROOT)/$(BuildMode)/bin)``. This ensures that :program:`lit` does
239not invoke any stray LLVM tools in the user's path during testing.
240
241Each RUN line is executed on its own, distinct from other lines unless
242its last character is ``\``. This continuation character causes the RUN
243line to be concatenated with the next one. In this way you can build up
244long pipelines of commands without making huge line lengths. The lines
245ending in ``\`` are concatenated until a RUN line that doesn't end in
246``\`` is found. This concatenated set of RUN lines then constitutes one
247execution. :program:`lit` will substitute variables and arrange for the pipeline
248to be executed. If any process in the pipeline fails, the entire line (and
249test case) fails too.
250
251Below is an example of legal RUN lines in a ``.ll`` file:
252
253.. code-block:: llvm
254
255    ; RUN: llvm-as < %s | llvm-dis > %t1
256    ; RUN: llvm-dis < %s.bc-13 > %t2
257    ; RUN: diff %t1 %t2
258
259As with a Unix shell, the RUN lines permit pipelines and I/O
260redirection to be used.
261
262There are some quoting rules that you must pay attention to when writing
263your RUN lines. In general nothing needs to be quoted. :program:`lit` won't
264strip off any quote characters so they will get passed to the invoked program.
265To avoid this use curly braces to tell :program:`lit` that it should treat
266everything enclosed as one value.
267
268In general, you should strive to keep your RUN lines as simple as possible,
269using them only to run tools that generate textual output you can then examine.
270The recommended way to examine output to figure out if the test passes is using
271the :doc:`FileCheck tool <CommandGuide/FileCheck>`. *[The usage of grep in RUN
272lines is deprecated - please do not send or commit patches that use it.]*
273
274Put related tests into a single file rather than having a separate file per
275test. Check if there are files already covering your feature and consider
276adding your code there instead of creating a new file.
277
278Generating assertions in regression tests
279-----------------------------------------
280
281Some regression test cases are very large and complex to write/update by hand.
282In that case to reduce the human work we can use the scripts available in
283llvm/utils/ to generate the assertions.
284
285For example to generate assertions in an :program:`llc`-based test, run:
286
287 .. code-block:: bash
288
289     % llvm/utils/update_llc_test_checks.py --llc-binary build/bin/llc test.ll
290
291And if you want to update assertions in an existing test case, pass `-u` option
292which first check the ``NOTE:`` line exists and matches the script name.
293
294These are the most common scripts and their purposes/applications in generating
295assertions:
296
297.. code-block:: none
298
299  update_analyze_test_checks.py
300  opt -passes='print<cost-model>'
301
302  update_cc_test_checks.py
303  C/C++, or clang/clang++ (IR checks)
304
305  update_llc_test_checks.py
306  llc (assembly checks)
307
308  update_mca_test_checks.py
309  llvm-mca
310
311  update_mir_test_checks.py
312  llc (MIR checks)
313
314  update_test_checks.py
315  opt
316
317Extra files
318-----------
319
320If your test requires extra files besides the file containing the ``RUN:`` lines
321and the extra files are small, consider specifying them in the same file and
322using ``split-file`` to extract them. For example,
323
324.. code-block:: llvm
325
326  ; RUN: split-file %s %t
327  ; RUN: llvm-link -S %t/a.ll %t/b.ll | FileCheck %s
328
329  ; CHECK: ...
330
331  ;--- a.ll
332  ...
333  ;--- b.ll
334  ...
335
336The parts are separated by the regex ``^(.|//)--- <part>``.
337
338If you want to test relative line numbers like ``[[#@LINE+1]]``, specify
339``--leading-lines`` to add leading empty lines to preserve line numbers.
340
341If the extra files are large, the idiomatic place to put them is in a subdirectory ``Inputs``.
342You can then refer to the extra files as ``%S/Inputs/foo.bar``.
343
344For example, consider ``test/Linker/ident.ll``. The directory structure is
345as follows::
346
347  test/
348    Linker/
349      ident.ll
350      Inputs/
351        ident.a.ll
352        ident.b.ll
353
354For convenience, these are the contents:
355
356.. code-block:: llvm
357
358  ;;;;; ident.ll:
359
360  ; RUN: llvm-link %S/Inputs/ident.a.ll %S/Inputs/ident.b.ll -S | FileCheck %s
361
362  ; Verify that multiple input llvm.ident metadata are linked together.
363
364  ; CHECK-DAG: !llvm.ident = !{!0, !1, !2}
365  ; CHECK-DAG: "Compiler V1"
366  ; CHECK-DAG: "Compiler V2"
367  ; CHECK-DAG: "Compiler V3"
368
369  ;;;;; Inputs/ident.a.ll:
370
371  !llvm.ident = !{!0, !1}
372  !0 = metadata !{metadata !"Compiler V1"}
373  !1 = metadata !{metadata !"Compiler V2"}
374
375  ;;;;; Inputs/ident.b.ll:
376
377  !llvm.ident = !{!0}
378  !0 = metadata !{metadata !"Compiler V3"}
379
380For symmetry reasons, ``ident.ll`` is just a dummy file that doesn't
381actually participate in the test besides holding the ``RUN:`` lines.
382
383.. note::
384
385  Some existing tests use ``RUN: true`` in extra files instead of just
386  putting the extra files in an ``Inputs/`` directory. This pattern is
387  deprecated.
388
389Fragile tests
390-------------
391
392It is easy to write a fragile test that would fail spuriously if the tool being
393tested outputs a full path to the input file.  For example, :program:`opt` by
394default outputs a ``ModuleID``:
395
396.. code-block:: console
397
398  $ cat example.ll
399  define i32 @main() nounwind {
400      ret i32 0
401  }
402
403  $ opt -S /path/to/example.ll
404  ; ModuleID = '/path/to/example.ll'
405
406  define i32 @main() nounwind {
407      ret i32 0
408  }
409
410``ModuleID`` can unexpectedly match against ``CHECK`` lines.  For example:
411
412.. code-block:: llvm
413
414  ; RUN: opt -S %s | FileCheck
415
416  define i32 @main() nounwind {
417      ; CHECK-NOT: load
418      ret i32 0
419  }
420
421This test will fail if placed into a ``download`` directory.
422
423To make your tests robust, always use ``opt ... < %s`` in the RUN line.
424:program:`opt` does not output a ``ModuleID`` when input comes from stdin.
425
426Platform-Specific Tests
427-----------------------
428
429Whenever adding tests that require the knowledge of a specific platform,
430either related to code generated, specific output or back-end features,
431you must make sure to isolate the features, so that buildbots that
432run on different architectures (and don't even compile all back-ends),
433don't fail.
434
435The first problem is to check for target-specific output, for example sizes
436of structures, paths and architecture names, for example:
437
438* Tests containing Windows paths will fail on Linux and vice-versa.
439* Tests that check for ``x86_64`` somewhere in the text will fail anywhere else.
440* Tests where the debug information calculates the size of types and structures.
441
442Also, if the test rely on any behaviour that is coded in any back-end, it must
443go in its own directory. So, for instance, code generator tests for ARM go
444into ``test/CodeGen/ARM`` and so on. Those directories contain a special
445``lit`` configuration file that ensure all tests in that directory will
446only run if a specific back-end is compiled and available.
447
448For instance, on ``test/CodeGen/ARM``, the ``lit.local.cfg`` is:
449
450.. code-block:: python
451
452  config.suffixes = ['.ll', '.c', '.cpp', '.test']
453  if not 'ARM' in config.root.targets:
454    config.unsupported = True
455
456Other platform-specific tests are those that depend on a specific feature
457of a specific sub-architecture, for example only to Intel chips that support ``AVX2``.
458
459For instance, ``test/CodeGen/X86/psubus.ll`` tests three sub-architecture
460variants:
461
462.. code-block:: llvm
463
464  ; RUN: llc -mcpu=core2 < %s | FileCheck %s -check-prefix=SSE2
465  ; RUN: llc -mcpu=corei7-avx < %s | FileCheck %s -check-prefix=AVX1
466  ; RUN: llc -mcpu=core-avx2 < %s | FileCheck %s -check-prefix=AVX2
467
468And the checks are different:
469
470.. code-block:: llvm
471
472  ; SSE2: @test1
473  ; SSE2: psubusw LCPI0_0(%rip), %xmm0
474  ; AVX1: @test1
475  ; AVX1: vpsubusw LCPI0_0(%rip), %xmm0, %xmm0
476  ; AVX2: @test1
477  ; AVX2: vpsubusw LCPI0_0(%rip), %xmm0, %xmm0
478
479So, if you're testing for a behaviour that you know is platform-specific or
480depends on special features of sub-architectures, you must add the specific
481triple, test with the specific FileCheck and put it into the specific
482directory that will filter out all other architectures.
483
484
485Constraining test execution
486---------------------------
487
488Some tests can be run only in specific configurations, such as
489with debug builds or on particular platforms. Use ``REQUIRES``
490and ``UNSUPPORTED`` to control when the test is enabled.
491
492Some tests are expected to fail. For example, there may be a known bug
493that the test detect. Use ``XFAIL`` to mark a test as an expected failure.
494An ``XFAIL`` test will be successful if its execution fails, and
495will be a failure if its execution succeeds.
496
497.. code-block:: llvm
498
499    ; This test will be only enabled in the build with asserts.
500    ; REQUIRES: asserts
501    ; This test is disabled on Linux.
502    ; UNSUPPORTED: -linux-
503    ; This test is expected to fail on PowerPC.
504    ; XFAIL: powerpc
505
506``REQUIRES`` and ``UNSUPPORTED`` and ``XFAIL`` all accept a comma-separated
507list of boolean expressions. The values in each expression may be:
508
509- Features added to ``config.available_features`` by configuration files such as ``lit.cfg``.
510  String comparison of features is case-sensitive. Furthermore, a boolean expression can
511  contain any Python regular expression enclosed in ``{{ }}``, in which case the boolean
512  expression is satisfied if any feature matches the regular expression. Regular
513  expressions can appear inside an identifier, so for example ``he{{l+}}o`` would match
514  ``helo``, ``hello``, ``helllo``, and so on.
515- Substrings of the target triple (``UNSUPPORTED`` and ``XFAIL`` only).
516
517| ``REQUIRES`` enables the test if all expressions are true.
518| ``UNSUPPORTED`` disables the test if any expression is true.
519| ``XFAIL`` expects the test to fail if any expression is true.
520
521As a special case, ``XFAIL: *`` is expected to fail everywhere.
522
523.. code-block:: llvm
524
525    ; This test is disabled on Windows,
526    ; and is disabled on Linux, except for Android Linux.
527    ; UNSUPPORTED: windows, linux && !android
528    ; This test is expected to fail on both PowerPC and ARM.
529    ; XFAIL: powerpc || arm
530
531
532Substitutions
533-------------
534
535Besides replacing LLVM tool names the following substitutions are performed in
536RUN lines:
537
538``%%``
539   Replaced by a single ``%``. This allows escaping other substitutions.
540
541``%s``
542   File path to the test case's source. This is suitable for passing on the
543   command line as the input to an LLVM tool.
544
545   Example: ``/home/user/llvm/test/MC/ELF/foo_test.s``
546
547``%S``
548   Directory path to the test case's source.
549
550   Example: ``/home/user/llvm/test/MC/ELF``
551
552``%t``
553   File path to a temporary file name that could be used for this test case.
554   The file name won't conflict with other test cases. You can append to it
555   if you need multiple temporaries. This is useful as the destination of
556   some redirected output.
557
558   Example: ``/home/user/llvm.build/test/MC/ELF/Output/foo_test.s.tmp``
559
560``%T``
561   Directory of ``%t``. Deprecated. Shouldn't be used, because it can be easily
562   misused and cause race conditions between tests.
563
564   Use ``rm -rf %t && mkdir %t`` instead if a temporary directory is necessary.
565
566   Example: ``/home/user/llvm.build/test/MC/ELF/Output``
567
568``%{pathsep}``
569
570   Expands to the path separator, i.e. ``:`` (or ``;`` on Windows).
571
572``${fs-src-root}``
573   Expands to the root component of file system paths for the source directory,
574   i.e. ``/`` on Unix systems or ``C:\`` (or another drive) on Windows.
575
576``${fs-tmp-root}``
577   Expands to the root component of file system paths for the test's temporary
578   directory, i.e. ``/`` on Unix systems or ``C:\`` (or another drive) on
579   Windows.
580
581``${fs-sep}``
582   Expands to the file system separator, i.e. ``/`` or ``\`` on Windows.
583
584``%/s, %/S, %/t, %/T:``
585
586  Act like the corresponding substitution above but replace any ``\``
587  character with a ``/``. This is useful to normalize path separators.
588
589   Example: ``%s:  C:\Desktop Files/foo_test.s.tmp``
590
591   Example: ``%/s: C:/Desktop Files/foo_test.s.tmp``
592
593``%:s, %:S, %:t, %:T:``
594
595  Act like the corresponding substitution above but remove colons at
596  the beginning of Windows paths. This is useful to allow concatenation
597  of absolute paths on Windows to produce a legal path.
598
599   Example: ``%s:  C:\Desktop Files\foo_test.s.tmp``
600
601   Example: ``%:s: C\Desktop Files\foo_test.s.tmp``
602
603``%errc_<ERRCODE>``
604
605 Some error messages may be substituted to allow different spellings
606 based on the host platform.
607
608   The following error codes are currently supported:
609   ENOENT, EISDIR, EINVAL, EACCES.
610
611   Example: ``Linux %errc_ENOENT: No such file or directory``
612
613   Example: ``Windows %errc_ENOENT: no such file or directory``
614
615``%if feature %{<if branch>%} %else %{<else branch>%}``
616
617 Conditional substitution: if ``feature`` is available it expands to
618 ``<if branch>``, otherwise it expands to ``<else branch>``.
619 ``%else %{<else branch>%}`` is optional and treated like ``%else %{%}``
620 if not present.
621
622**LLVM-specific substitutions:**
623
624``%shlibext``
625   The suffix for the host platforms shared library files. This includes the
626   period as the first character.
627
628   Example: ``.so`` (Linux), ``.dylib`` (macOS), ``.dll`` (Windows)
629
630``%exeext``
631   The suffix for the host platforms executable files. This includes the
632   period as the first character.
633
634   Example: ``.exe`` (Windows), empty on Linux.
635
636``%(line)``, ``%(line+<number>)``, ``%(line-<number>)``
637   The number of the line where this substitution is used, with an optional
638   integer offset. This can be used in tests with multiple RUN lines, which
639   reference test file's line numbers.
640
641
642**Clang-specific substitutions:**
643
644``%clang``
645   Invokes the Clang driver.
646
647``%clang_cpp``
648   Invokes the Clang driver for C++.
649
650``%clang_cl``
651   Invokes the CL-compatible Clang driver.
652
653``%clangxx``
654   Invokes the G++-compatible Clang driver.
655
656``%clang_cc1``
657   Invokes the Clang frontend.
658
659``%itanium_abi_triple``, ``%ms_abi_triple``
660   These substitutions can be used to get the current target triple adjusted to
661   the desired ABI. For example, if the test suite is running with the
662   ``i686-pc-win32`` target, ``%itanium_abi_triple`` will expand to
663   ``i686-pc-mingw32``. This allows a test to run with a specific ABI without
664   constraining it to a specific triple.
665
666**FileCheck-specific substitutions:**
667
668``%ProtectFileCheckOutput``
669   This should precede a ``FileCheck`` call if and only if the call's textual
670   output affects test results.  It's usually easy to tell: just look for
671   redirection or piping of the ``FileCheck`` call's stdout or stderr.
672
673To add more substitutions, look at ``test/lit.cfg`` or ``lit.local.cfg``.
674
675
676Options
677-------
678
679The llvm lit configuration allows to customize some things with user options:
680
681``llc``, ``opt``, ...
682    Substitute the respective llvm tool name with a custom command line. This
683    allows to specify custom paths and default arguments for these tools.
684    Example:
685
686    % llvm-lit "-Dllc=llc -verify-machineinstrs"
687
688``run_long_tests``
689    Enable the execution of long running tests.
690
691``llvm_site_config``
692    Load the specified lit configuration instead of the default one.
693
694
695Other Features
696--------------
697
698To make RUN line writing easier, there are several helper programs. These
699helpers are in the PATH when running tests, so you can just call them using
700their name. For example:
701
702``not``
703   This program runs its arguments and then inverts the result code from it.
704   Zero result codes become 1. Non-zero result codes become 0.
705
706To make the output more useful, :program:`lit` will scan
707the lines of the test case for ones that contain a pattern that matches
708``PR[0-9]+``. This is the syntax for specifying a PR (Problem Report) number
709that is related to the test case. The number after "PR" specifies the
710LLVM Bugzilla number. When a PR number is specified, it will be used in
711the pass/fail reporting. This is useful to quickly get some context when
712a test fails.
713
714Finally, any line that contains "END." will cause the special
715interpretation of lines to terminate. This is generally done right after
716the last RUN: line. This has two side effects:
717
718(a) it prevents special interpretation of lines that are part of the test
719    program, not the instructions to the test case, and
720
721(b) it speeds things up for really big test cases by avoiding
722    interpretation of the remainder of the file.
723