annotate compiler-rt/docs/TestingGuide.rst @ 259:011663b4a808

remove duplicate setjmp in return continuation
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 12 Oct 2023 15:52:37 +0900
parents 1f2b6ac9f198
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ========================================
anatofuz
parents:
diff changeset
2 Compiler-rt Testing Infrastructure Guide
anatofuz
parents:
diff changeset
3 ========================================
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 .. contents::
anatofuz
parents:
diff changeset
6 :local:
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 Overview
anatofuz
parents:
diff changeset
9 ========
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 This document is the reference manual for the compiler-rt modifications to the
anatofuz
parents:
diff changeset
12 testing infrastructure. Documentation for the infrastructure itself can be found at
anatofuz
parents:
diff changeset
13 :ref:`llvm_testing_guide`.
anatofuz
parents:
diff changeset
14
anatofuz
parents:
diff changeset
15 LLVM testing infrastructure organization
anatofuz
parents:
diff changeset
16 ========================================
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 The compiler-rt testing infrastructure contains regression tests which are run
anatofuz
parents:
diff changeset
19 as part of the usual ``make check-all`` and are expected to always pass -- they
anatofuz
parents:
diff changeset
20 should be run before every commit.
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 Quick start
anatofuz
parents:
diff changeset
23 ===========
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 The regressions tests are in the "compiler-rt" module and are normally checked
anatofuz
parents:
diff changeset
26 out in the directory ``llvm/projects/compiler-rt/test``. Use ``make check-all``
anatofuz
parents:
diff changeset
27 to run the regression tests after building compiler-rt.
anatofuz
parents:
diff changeset
28
anatofuz
parents:
diff changeset
29 REQUIRES, XFAIL, etc.
anatofuz
parents:
diff changeset
30 ---------------------
anatofuz
parents:
diff changeset
31
anatofuz
parents:
diff changeset
32 Sometimes it is necessary to restrict a test to a specific target or mark it as
anatofuz
parents:
diff changeset
33 an "expected fail" or XFAIL. This is normally achieved using ``REQUIRES:`` or
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
34 ``XFAIL:`` and the ``target=<target-triple>`` feature, typically with a regular
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
35 expression matching an appropriate substring of the triple. Unfortunately, the
150
anatofuz
parents:
diff changeset
36 behaviour of this is somewhat quirky in compiler-rt. There are two main
anatofuz
parents:
diff changeset
37 pitfalls to avoid.
anatofuz
parents:
diff changeset
38
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
39 The first pitfall is that these regular expressions may inadvertently match
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
40 more triples than expected. For example, ``XFAIL: target=mips{{.*}}`` matches
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
41 ``mips-linux-gnu``, ``mipsel-linux-gnu``, ``mips64-linux-gnu``, and
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
42 ``mips64el-linux-gnu``. Including a trailing ``-`` such as in
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
43 ``XFAIL: target=mips-{{.*}}`` can help to mitigate this quirk but even that has
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
44 issues as described below.
150
anatofuz
parents:
diff changeset
45
anatofuz
parents:
diff changeset
46 The second pitfall is that the default target triple is often inappropriate for
anatofuz
parents:
diff changeset
47 compiler-rt tests since compiler-rt tests may be compiled for multiple targets.
anatofuz
parents:
diff changeset
48 For example, a typical build on an ``x86_64-linux-gnu`` host will often run the
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
49 tests for both x86_64 and i386. In this situation ``XFAIL: target=x86_64{{{.*}}``
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
50 will mark both the x86_64 and i386 tests as an expected failure while
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
51 ``XFAIL: target=i386{{.*}}`` will have no effect at all.
150
anatofuz
parents:
diff changeset
52
anatofuz
parents:
diff changeset
53 To remedy both pitfalls, compiler-rt tests provide a feature string which can
anatofuz
parents:
diff changeset
54 be used to specify a single target. This string is of the form
anatofuz
parents:
diff changeset
55 ``target-is-${arch}`` where ``${arch}}`` is one of the values from the
anatofuz
parents:
diff changeset
56 following lines of the CMake output::
anatofuz
parents:
diff changeset
57
anatofuz
parents:
diff changeset
58 -- Compiler-RT supported architectures: x86_64;i386
anatofuz
parents:
diff changeset
59 -- Builtin supported architectures: i386;x86_64
anatofuz
parents:
diff changeset
60
anatofuz
parents:
diff changeset
61 So for example ``XFAIL: target-is-x86_64`` will mark a test as expected to fail
anatofuz
parents:
diff changeset
62 on x86_64 without also affecting the i386 test and ``XFAIL: target-is-i386``
anatofuz
parents:
diff changeset
63 will mark a test as expected to fail on i386 even if the default target triple
anatofuz
parents:
diff changeset
64 is ``x86_64-linux-gnu``. Directives that use these ``target-is-${arch}`` string
anatofuz
parents:
diff changeset
65 require exact matches so ``XFAIL: target-is-mips``,
anatofuz
parents:
diff changeset
66 ``XFAIL: target-is-mipsel``, ``XFAIL: target-is-mips64``, and
anatofuz
parents:
diff changeset
67 ``XFAIL: target-is-mips64el`` all refer to different MIPS targets.