[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Driver / baremetal-multilib.yaml
blobb6bfd0ed3a94cba485f67668d9d60ab5c4c7d46d
1 # REQUIRES: shell
2 # UNSUPPORTED: system-windows
4 # RUN: %clang --multi-lib-config=%s -no-canonical-prefixes -x c++ %s -### -o %t.out 2>&1 \
5 # RUN:     --target=thumbv8m.main-none-eabihf --sysroot= \
6 # RUN:   | FileCheck %s
7 # CHECK:      "-cc1" "-triple" "thumbv8m.main-unknown-none-eabihf"
8 # CHECK-SAME: "-internal-isystem" "[[SYSROOT:[^"]*]]/bin/../lib/clang-runtimes/arm-none-eabi/thumb/v8-m.main/fp/include/c++/v1"
9 # CHECK-SAME: "-internal-isystem" "[[SYSROOT]]/bin/../lib/clang-runtimes/arm-none-eabi/thumb/v8-m.main/fp/include"
10 # CHECK-SAME: "-x" "c++" "{{.*}}baremetal-multilib.yaml"
11 # CHECK-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
12 # CHECK-SAME: "-L[[SYSROOT]]/bin/../lib/clang-runtimes/arm-none-eabi/thumb/v8-m.main/fp/lib"
13 # CHECK-SAME: "-lc" "-lm" "{{[^"]*}}libclang_rt.builtins.a"
14 # CHECK-SAME: "-o" "{{.*}}.tmp.out"
16 # RUN: %clang --multi-lib-config=%s -no-canonical-prefixes -x c++ %s -### -o %t.out 2>&1 \
17 # RUN:     --target=thumbv7em-none-eabi -mfpu=fpv4-sp-d16 --sysroot= \
18 # RUN:   | FileCheck --check-prefix=CHECK-NO-MATCH %s
19 # CHECK-NO-MATCH: warning: no multilib found matching flags:
20 # CHECK-NO-MATCH-SAME: --target=thumbv7em-unknown-none-eabi
21 # CHECK-NO-MATCH: note: available multilibs are:
22 # CHECK-NO-MATCH: --target=thumbv6m-unknown-none-eabi -mfpu=none
23 # CHECK-NO-MATCH: --target=thumbv7m-unknown-none-eabi -mfpu=none
24 # CHECK-NO-MATCH: --target=thumbv7em-unknown-none-eabi -mfpu=none
26 # RUN: %clang --multi-lib-config=%s -no-canonical-prefixes -print-multi-directory 2>&1 \
27 # RUN:     --target=thumbv8m.main-none-eabihf --sysroot= \
28 # RUN:   | FileCheck --check-prefix=CHECK-PRINT-MULTI-DIRECTORY %s
29 # CHECK-PRINT-MULTI-DIRECTORY: arm-none-eabi/thumb/v8-m.main/fp
31 # RUN: %clang --multi-lib-config=%s -no-canonical-prefixes -print-multi-lib 2>&1 \
32 # RUN:     --target=arm-none-eabi --sysroot= \
33 # RUN:   | FileCheck --check-prefix=CHECK-PRINT-MULTI-LIB %s
34 # CHECK-PRINT-MULTI-LIB: arm-none-eabi/thumb/v6-m/nofp;@-target=thumbv6m-unknown-none-eabi@mfpu=none
35 # CHECK-PRINT-MULTI-LIB: arm-none-eabi/thumb/v7-m/nofp;@-target=thumbv7m-unknown-none-eabi@mfpu=none
36 # CHECK-PRINT-MULTI-LIB: arm-none-eabi/thumb/v7e-m/nofp;@-target=thumbv7em-unknown-none-eabi@mfpu=none
37 # CHECK-PRINT-MULTI-LIB: arm-none-eabi/thumb/v8-m.main/nofp;@-target=thumbv8m.main-unknown-none-eabi@mfpu=none
38 # CHECK-PRINT-MULTI-LIB: arm-none-eabi/thumb/v8.1-m.main/nofp/nomve;@-target=thumbv8.1m.main-unknown-none-eabi@mfpu=none
39 # CHECK-PRINT-MULTI-LIB: arm-none-eabi/thumb/v7e-m/fpv4_sp_d16;@-target=thumbv7em-unknown-none-eabihf@mfpu=fpv4-sp-d16
40 # CHECK-PRINT-MULTI-LIB: arm-none-eabi/thumb/v7e-m/fpv5_d16;@-target=thumbv7em-unknown-none-eabihf@mfpu=fpv5-d16
41 # CHECK-PRINT-MULTI-LIB: arm-none-eabi/thumb/v8-m.main/fp;@-target=thumbv8m.main-unknown-none-eabihf@mfpu=fpv5-d16
42 # CHECK-PRINT-MULTI-LIB: arm-none-eabi/thumb/v8.1-m.main/fp;@-target=thumbv8.1m.main-unknown-none-eabihf@mfpu=fp-armv8-fullfp16-sp-d16
43 # CHECK-PRINT-MULTI-LIB: arm-none-eabi/thumb/v8.1-m.main/nofp/mve;@-target=thumbv8.1m.main-unknown-none-eabihf@march=thumbv8.1m.main+mve@mfpu=none
45 # RUN: %clang --multi-lib-config=%s -no-canonical-prefixes -x assembler -mexecute-only \
46 # RUN:     --target=arm-none-eabi --sysroot= %s -c -### 2>&1 \
47 # RUN:    | FileCheck %s --check-prefix=CHECK-NO-EXECUTE-ONLY-ASM
48 # CHECK-NO-EXECUTE-ONLY-ASM: warning: argument unused during compilation: '-mexecute-only'
50 ---
51 # This file is in two parts:
52 # 1. A list of library variants.
53 # 2. A mapping from flags generated from command line arguments to further
54 #    flags.
56 # How does clang use this file?
57 # 1. If the ToolChain class for the architecture supports this form of
58 #    multilib it then it loads the file if present in sysroot.
59 # 2. Generate flags from the user provided arguments.
60 #    (Use `clang -print-multi-flags-experimental` to see which flags are
61 #    generated).
62 # 3. Compare the arguments against each regular expression and store
63 #    associated flags if there's a match.
64 # 4. Find the last library variant whose flags are a subset of the
65 #    flags derived from the user provided arguments.
66 # 5. Use the directory for the library variant as the sysroot.
68 # Clang will emit an error if this number is greater than its current multilib
69 # version or if its major version differs, but will accept lesser minor
70 # versions.
71 MultilibVersion: 1.0
73 # The first section of the file is the list of library variants.
74 # A library is considered compatible if the are a subset of the flags derived
75 # from the arguments provided by the user.
76 # If multiple libraries are deemed compatible then the one that appears
77 # last in the list wins. A ToolChain may instead opt to use more than one
78 # multilib, layered on top of each other.
80 Variants:
81 - Dir: arm-none-eabi/arm/v4t
82   Flags: [--target=armv4t-unknown-none-eabi]
84 - Dir: arm-none-eabi/thumb/v6-m/nofp
85   Flags: [--target=thumbv6m-unknown-none-eabi, -mfpu=none]
87 - Dir: arm-none-eabi/thumb/v7-m/nofp
88   Flags: [--target=thumbv7m-unknown-none-eabi, -mfpu=none]
90 - Dir: arm-none-eabi/thumb/v7e-m/nofp
91   Flags: [--target=thumbv7em-unknown-none-eabi, -mfpu=none]
93 - Dir: arm-none-eabi/thumb/v8-m.main/nofp
94   Flags: [--target=thumbv8m.main-unknown-none-eabi, -mfpu=none]
96 - Dir: arm-none-eabi/thumb/v8.1-m.main/nofp/nomve
97   Flags: [--target=thumbv8.1m.main-unknown-none-eabi, -mfpu=none]
99 - Dir: arm-none-eabi/thumb/v7e-m/fpv4_sp_d16
100   Flags: [--target=thumbv7em-unknown-none-eabihf, -mfpu=fpv4-sp-d16]
102 - Dir: arm-none-eabi/thumb/v7e-m/fpv5_d16
103   Flags: [--target=thumbv7em-unknown-none-eabihf, -mfpu=fpv5-d16]
105 - Dir: arm-none-eabi/thumb/v8-m.main/fp
106   Flags: [--target=thumbv8m.main-unknown-none-eabihf, -mfpu=fpv5-d16]
108 - Dir: arm-none-eabi/thumb/v8.1-m.main/fp
109   Flags: [--target=thumbv8.1m.main-unknown-none-eabihf, -mfpu=fp-armv8-fullfp16-sp-d16]
111 - Dir: arm-none-eabi/thumb/v8.1-m.main/nofp/mve
112   Flags: [--target=thumbv8.1m.main-unknown-none-eabihf, -march=thumbv8.1m.main+mve, -mfpu=none]
115 # The second section of the file is a map from auto-detected flags
116 # to custom flags. The auto-detected flags can be printed out
117 # by running clang with `-print-multi-flags-experimental`.
118 # The regex must match a whole flag string.
119 # All flags in the "Flags" list will be added if an argument matches.
120 Mappings:
121 # For v8m.base (and potential later v8m baseline versions) use v6m
122 - Match: --target=thumbv8(\.[0-9]+)?m\.base-unknown-none-eabi
123   Flags: [--target=thumbv6m-unknown-none-eabi]
124 # Match versions after v8.1m.main. We assume that v8.2m (if/when it exists) will
125 # be backwards compatible with v8.1m.
126 # The alternative is to not recognise later versions, and require that
127 # this multilib spec is updated before it can be used with newer
128 # architecture versions.
129 - Match: --target=thumbv8\.[1-9]m\.main-unknown-none-eabi
130   Flags: [--target=thumbv8.1m.main-unknown-none-eabi]
131 - Match: --target=thumbv8\.[1-9]m\.main-unknown-none-eabihf
132   Flags: [--target=thumbv8.1m.main-unknown-none-eabihf]
134 - Match: -march=thumbv8\.[1-9]m\.main.*\+mve($|\+).*
135   Flags: [-march=thumbv8.1m.main+mve]
137 # Hierarchy among FPUs: fpvN-d16 is a superset of fpvN-sp-d16, and
138 # fpvN-d16 is a superset of fpv[N-1]-d16, for all N.
139 - Match: -mfpu=fpv5-d16
140   Flags:
141   - -mfpu=fpv4-d16
142   - -mfpu=fpv5-sp-d16
143   - -mfpu=fpv4-sp-d16
144 - Match: -mfpu=fpv5-sp-d16
145   Flags:
146   - -mfpu=fpv4-sp-d16
147 - Match: -mfpu=fpv4-d16
148   Flags:
149   - -mfpu=fpv4-sp-d16