| ... | @@ -34,6 +34,7 @@ const TestTarget = struct { | ... | @@ -34,6 +34,7 @@ const TestTarget = struct { |
| 34 | link_libc: bool = false, | 34 | link_libc: bool = false, |
| 35 | single_threaded: bool = false, | 35 | single_threaded: bool = false, |
| 36 | disable_native: bool = false, | 36 | disable_native: bool = false, |
| | 37 | backend: ?std.builtin.CompilerBackend = null, |
| 37 | }; | 38 | }; |
| 38 | | 39 | |
| 39 | const test_targets = blk: { | 40 | const test_targets = blk: { |
| ... | @@ -42,15 +43,73 @@ const test_targets = blk: { | ... | @@ -42,15 +43,73 @@ const test_targets = blk: { |
| 42 | // lot of branches) | 43 | // lot of branches) |
| 43 | @setEvalBranchQuota(50000); | 44 | @setEvalBranchQuota(50000); |
| 44 | break :blk [_]TestTarget{ | 45 | break :blk [_]TestTarget{ |
| 45 | TestTarget{}, | 46 | .{}, |
| 46 | TestTarget{ | 47 | .{ |
| 47 | .link_libc = true, | 48 | .link_libc = true, |
| 48 | }, | 49 | }, |
| 49 | TestTarget{ | 50 | .{ |
| 50 | .single_threaded = true, | 51 | .single_threaded = true, |
| 51 | }, | 52 | }, |
| 52 | | 53 | |
| 53 | TestTarget{ | 54 | .{ |
| | 55 | .link_libc = true, |
| | 56 | .backend = .stage2_c, |
| | 57 | }, |
| | 58 | .{ |
| | 59 | .target = .{ |
| | 60 | .cpu_arch = .x86_64, |
| | 61 | .os_tag = .linux, |
| | 62 | .abi = .none, |
| | 63 | }, |
| | 64 | .backend = .stage2_x86_64, |
| | 65 | }, |
| | 66 | .{ |
| | 67 | .target = .{ |
| | 68 | .cpu_arch = .aarch64, |
| | 69 | .os_tag = .linux, |
| | 70 | }, |
| | 71 | .backend = .stage2_aarch64, |
| | 72 | }, |
| | 73 | .{ |
| | 74 | .target = .{ |
| | 75 | .cpu_arch = .wasm32, |
| | 76 | .os_tag = .wasi, |
| | 77 | }, |
| | 78 | .single_threaded = true, |
| | 79 | .backend = .stage2_wasm, |
| | 80 | }, |
| | 81 | .{ |
| | 82 | .target = .{ |
| | 83 | .cpu_arch = .arm, |
| | 84 | .os_tag = .linux, |
| | 85 | }, |
| | 86 | .backend = .stage2_wasm, |
| | 87 | }, |
| | 88 | .{ |
| | 89 | .target = CrossTarget.parse(.{ |
| | 90 | .arch_os_abi = "arm-linux-none", |
| | 91 | .cpu_features = "generic+v8a", |
| | 92 | }) catch unreachable, |
| | 93 | .backend = .stage2_arm, |
| | 94 | }, |
| | 95 | .{ |
| | 96 | .target = .{ |
| | 97 | .cpu_arch = .aarch64, |
| | 98 | .os_tag = .macos, |
| | 99 | .abi = .gnu, |
| | 100 | }, |
| | 101 | .backend = .stage2_aarch64, |
| | 102 | }, |
| | 103 | .{ |
| | 104 | .target = .{ |
| | 105 | .cpu_arch = .x86_64, |
| | 106 | .os_tag = .macos, |
| | 107 | .abi = .gnu, |
| | 108 | }, |
| | 109 | .backend = .stage2_x86_64, |
| | 110 | }, |
| | 111 | |
| | 112 | .{ |
| 54 | .target = .{ | 113 | .target = .{ |
| 55 | .cpu_arch = .wasm32, | 114 | .cpu_arch = .wasm32, |
| 56 | .os_tag = .wasi, | 115 | .os_tag = .wasi, |
| ... | @@ -58,7 +117,7 @@ const test_targets = blk: { | ... | @@ -58,7 +117,7 @@ const test_targets = blk: { |
| 58 | .link_libc = false, | 117 | .link_libc = false, |
| 59 | .single_threaded = true, | 118 | .single_threaded = true, |
| 60 | }, | 119 | }, |
| 61 | TestTarget{ | 120 | .{ |
| 62 | .target = .{ | 121 | .target = .{ |
| 63 | .cpu_arch = .wasm32, | 122 | .cpu_arch = .wasm32, |
| 64 | .os_tag = .wasi, | 123 | .os_tag = .wasi, |
| ... | @@ -67,14 +126,14 @@ const test_targets = blk: { | ... | @@ -67,14 +126,14 @@ const test_targets = blk: { |
| 67 | .single_threaded = true, | 126 | .single_threaded = true, |
| 68 | }, | 127 | }, |
| 69 | | 128 | |
| 70 | TestTarget{ | 129 | .{ |
| 71 | .target = .{ | 130 | .target = .{ |
| 72 | .cpu_arch = .x86_64, | 131 | .cpu_arch = .x86_64, |
| 73 | .os_tag = .linux, | 132 | .os_tag = .linux, |
| 74 | .abi = .none, | 133 | .abi = .none, |
| 75 | }, | 134 | }, |
| 76 | }, | 135 | }, |
| 77 | TestTarget{ | 136 | .{ |
| 78 | .target = .{ | 137 | .target = .{ |
| 79 | .cpu_arch = .x86_64, | 138 | .cpu_arch = .x86_64, |
| 80 | .os_tag = .linux, | 139 | .os_tag = .linux, |
| ... | @@ -82,7 +141,7 @@ const test_targets = blk: { | ... | @@ -82,7 +141,7 @@ const test_targets = blk: { |
| 82 | }, | 141 | }, |
| 83 | .link_libc = true, | 142 | .link_libc = true, |
| 84 | }, | 143 | }, |
| 85 | TestTarget{ | 144 | .{ |
| 86 | .target = .{ | 145 | .target = .{ |
| 87 | .cpu_arch = .x86_64, | 146 | .cpu_arch = .x86_64, |
| 88 | .os_tag = .linux, | 147 | .os_tag = .linux, |
| ... | @@ -91,14 +150,14 @@ const test_targets = blk: { | ... | @@ -91,14 +150,14 @@ const test_targets = blk: { |
| 91 | .link_libc = true, | 150 | .link_libc = true, |
| 92 | }, | 151 | }, |
| 93 | | 152 | |
| 94 | TestTarget{ | 153 | .{ |
| 95 | .target = .{ | 154 | .target = .{ |
| 96 | .cpu_arch = .i386, | 155 | .cpu_arch = .i386, |
| 97 | .os_tag = .linux, | 156 | .os_tag = .linux, |
| 98 | .abi = .none, | 157 | .abi = .none, |
| 99 | }, | 158 | }, |
| 100 | }, | 159 | }, |
| 101 | TestTarget{ | 160 | .{ |
| 102 | .target = .{ | 161 | .target = .{ |
| 103 | .cpu_arch = .i386, | 162 | .cpu_arch = .i386, |
| 104 | .os_tag = .linux, | 163 | .os_tag = .linux, |
| ... | @@ -106,7 +165,7 @@ const test_targets = blk: { | ... | @@ -106,7 +165,7 @@ const test_targets = blk: { |
| 106 | }, | 165 | }, |
| 107 | .link_libc = true, | 166 | .link_libc = true, |
| 108 | }, | 167 | }, |
| 109 | TestTarget{ | 168 | .{ |
| 110 | .target = .{ | 169 | .target = .{ |
| 111 | .cpu_arch = .i386, | 170 | .cpu_arch = .i386, |
| 112 | .os_tag = .linux, | 171 | .os_tag = .linux, |
| ... | @@ -115,14 +174,14 @@ const test_targets = blk: { | ... | @@ -115,14 +174,14 @@ const test_targets = blk: { |
| 115 | .link_libc = true, | 174 | .link_libc = true, |
| 116 | }, | 175 | }, |
| 117 | | 176 | |
| 118 | TestTarget{ | 177 | .{ |
| 119 | .target = .{ | 178 | .target = .{ |
| 120 | .cpu_arch = .aarch64, | 179 | .cpu_arch = .aarch64, |
| 121 | .os_tag = .linux, | 180 | .os_tag = .linux, |
| 122 | .abi = .none, | 181 | .abi = .none, |
| 123 | }, | 182 | }, |
| 124 | }, | 183 | }, |
| 125 | TestTarget{ | 184 | .{ |
| 126 | .target = .{ | 185 | .target = .{ |
| 127 | .cpu_arch = .aarch64, | 186 | .cpu_arch = .aarch64, |
| 128 | .os_tag = .linux, | 187 | .os_tag = .linux, |
| ... | @@ -130,7 +189,7 @@ const test_targets = blk: { | ... | @@ -130,7 +189,7 @@ const test_targets = blk: { |
| 130 | }, | 189 | }, |
| 131 | .link_libc = true, | 190 | .link_libc = true, |
| 132 | }, | 191 | }, |
| 133 | TestTarget{ | 192 | .{ |
| 134 | .target = .{ | 193 | .target = .{ |
| 135 | .cpu_arch = .aarch64, | 194 | .cpu_arch = .aarch64, |
| 136 | .os_tag = .linux, | 195 | .os_tag = .linux, |
| ... | @@ -138,7 +197,7 @@ const test_targets = blk: { | ... | @@ -138,7 +197,7 @@ const test_targets = blk: { |
| 138 | }, | 197 | }, |
| 139 | .link_libc = true, | 198 | .link_libc = true, |
| 140 | }, | 199 | }, |
| 141 | TestTarget{ | 200 | .{ |
| 142 | .target = .{ | 201 | .target = .{ |
| 143 | .cpu_arch = .aarch64, | 202 | .cpu_arch = .aarch64, |
| 144 | .os_tag = .windows, | 203 | .os_tag = .windows, |
| ... | @@ -147,13 +206,13 @@ const test_targets = blk: { | ... | @@ -147,13 +206,13 @@ const test_targets = blk: { |
| 147 | .link_libc = true, | 206 | .link_libc = true, |
| 148 | }, | 207 | }, |
| 149 | | 208 | |
| 150 | TestTarget{ | 209 | .{ |
| 151 | .target = CrossTarget.parse(.{ | 210 | .target = CrossTarget.parse(.{ |
| 152 | .arch_os_abi = "arm-linux-none", | 211 | .arch_os_abi = "arm-linux-none", |
| 153 | .cpu_features = "generic+v8a", | 212 | .cpu_features = "generic+v8a", |
| 154 | }) catch unreachable, | 213 | }) catch unreachable, |
| 155 | }, | 214 | }, |
| 156 | TestTarget{ | 215 | .{ |
| 157 | .target = CrossTarget.parse(.{ | 216 | .target = CrossTarget.parse(.{ |
| 158 | .arch_os_abi = "arm-linux-musleabihf", | 217 | .arch_os_abi = "arm-linux-musleabihf", |
| 159 | .cpu_features = "generic+v8a", | 218 | .cpu_features = "generic+v8a", |
| ... | @@ -161,7 +220,7 @@ const test_targets = blk: { | ... | @@ -161,7 +220,7 @@ const test_targets = blk: { |
| 161 | .link_libc = true, | 220 | .link_libc = true, |
| 162 | }, | 221 | }, |
| 163 | // https://github.com/ziglang/zig/issues/3287 | 222 | // https://github.com/ziglang/zig/issues/3287 |
| 164 | //TestTarget{ | 223 | //.{ |
| 165 | // .target = CrossTarget.parse(.{ | 224 | // .target = CrossTarget.parse(.{ |
| 166 | // .arch_os_abi = "arm-linux-gnueabihf", | 225 | // .arch_os_abi = "arm-linux-gnueabihf", |
| 167 | // .cpu_features = "generic+v8a", | 226 | // .cpu_features = "generic+v8a", |
| ... | @@ -169,7 +228,7 @@ const test_targets = blk: { | ... | @@ -169,7 +228,7 @@ const test_targets = blk: { |
| 169 | // .link_libc = true, | 228 | // .link_libc = true, |
| 170 | //}, | 229 | //}, |
| 171 | | 230 | |
| 172 | TestTarget{ | 231 | .{ |
| 173 | .target = .{ | 232 | .target = .{ |
| 174 | .cpu_arch = .mips, | 233 | .cpu_arch = .mips, |
| 175 | .os_tag = .linux, | 234 | .os_tag = .linux, |
| ... | @@ -177,7 +236,7 @@ const test_targets = blk: { | ... | @@ -177,7 +236,7 @@ const test_targets = blk: { |
| 177 | }, | 236 | }, |
| 178 | }, | 237 | }, |
| 179 | | 238 | |
| 180 | TestTarget{ | 239 | .{ |
| 181 | .target = .{ | 240 | .target = .{ |
| 182 | .cpu_arch = .mips, | 241 | .cpu_arch = .mips, |
| 183 | .os_tag = .linux, | 242 | .os_tag = .linux, |
| ... | @@ -187,7 +246,7 @@ const test_targets = blk: { | ... | @@ -187,7 +246,7 @@ const test_targets = blk: { |
| 187 | }, | 246 | }, |
| 188 | | 247 | |
| 189 | // https://github.com/ziglang/zig/issues/4927 | 248 | // https://github.com/ziglang/zig/issues/4927 |
| 190 | //TestTarget{ | 249 | //.{ |
| 191 | // .target = .{ | 250 | // .target = .{ |
| 192 | // .cpu_arch = .mips, | 251 | // .cpu_arch = .mips, |
| 193 | // .os_tag = .linux, | 252 | // .os_tag = .linux, |
| ... | @@ -196,7 +255,7 @@ const test_targets = blk: { | ... | @@ -196,7 +255,7 @@ const test_targets = blk: { |
| 196 | // .link_libc = true, | 255 | // .link_libc = true, |
| 197 | //}, | 256 | //}, |
| 198 | | 257 | |
| 199 | TestTarget{ | 258 | .{ |
| 200 | .target = .{ | 259 | .target = .{ |
| 201 | .cpu_arch = .mipsel, | 260 | .cpu_arch = .mipsel, |
| 202 | .os_tag = .linux, | 261 | .os_tag = .linux, |
| ... | @@ -204,7 +263,7 @@ const test_targets = blk: { | ... | @@ -204,7 +263,7 @@ const test_targets = blk: { |
| 204 | }, | 263 | }, |
| 205 | }, | 264 | }, |
| 206 | | 265 | |
| 207 | TestTarget{ | 266 | .{ |
| 208 | .target = .{ | 267 | .target = .{ |
| 209 | .cpu_arch = .mipsel, | 268 | .cpu_arch = .mipsel, |
| 210 | .os_tag = .linux, | 269 | .os_tag = .linux, |
| ... | @@ -214,7 +273,7 @@ const test_targets = blk: { | ... | @@ -214,7 +273,7 @@ const test_targets = blk: { |
| 214 | }, | 273 | }, |
| 215 | | 274 | |
| 216 | // https://github.com/ziglang/zig/issues/4927 | 275 | // https://github.com/ziglang/zig/issues/4927 |
| 217 | //TestTarget{ | 276 | //.{ |
| 218 | // .target = .{ | 277 | // .target = .{ |
| 219 | // .cpu_arch = .mipsel, | 278 | // .cpu_arch = .mipsel, |
| 220 | // .os_tag = .linux, | 279 | // .os_tag = .linux, |
| ... | @@ -223,14 +282,14 @@ const test_targets = blk: { | ... | @@ -223,14 +282,14 @@ const test_targets = blk: { |
| 223 | // .link_libc = true, | 282 | // .link_libc = true, |
| 224 | //}, | 283 | //}, |
| 225 | | 284 | |
| 226 | TestTarget{ | 285 | .{ |
| 227 | .target = .{ | 286 | .target = .{ |
| 228 | .cpu_arch = .powerpc, | 287 | .cpu_arch = .powerpc, |
| 229 | .os_tag = .linux, | 288 | .os_tag = .linux, |
| 230 | .abi = .none, | 289 | .abi = .none, |
| 231 | }, | 290 | }, |
| 232 | }, | 291 | }, |
| 233 | TestTarget{ | 292 | .{ |
| 234 | .target = .{ | 293 | .target = .{ |
| 235 | .cpu_arch = .powerpc, | 294 | .cpu_arch = .powerpc, |
| 236 | .os_tag = .linux, | 295 | .os_tag = .linux, |
| ... | @@ -239,7 +298,7 @@ const test_targets = blk: { | ... | @@ -239,7 +298,7 @@ const test_targets = blk: { |
| 239 | .link_libc = true, | 298 | .link_libc = true, |
| 240 | }, | 299 | }, |
| 241 | // https://github.com/ziglang/zig/issues/2256 | 300 | // https://github.com/ziglang/zig/issues/2256 |
| 242 | //TestTarget{ | 301 | //.{ |
| 243 | // .target = .{ | 302 | // .target = .{ |
| 244 | // .cpu_arch = .powerpc, | 303 | // .cpu_arch = .powerpc, |
| 245 | // .os_tag = .linux, | 304 | // .os_tag = .linux, |
| ... | @@ -248,7 +307,7 @@ const test_targets = blk: { | ... | @@ -248,7 +307,7 @@ const test_targets = blk: { |
| 248 | // .link_libc = true, | 307 | // .link_libc = true, |
| 249 | //}, | 308 | //}, |
| 250 | | 309 | |
| 251 | TestTarget{ | 310 | .{ |
| 252 | .target = .{ | 311 | .target = .{ |
| 253 | .cpu_arch = .riscv64, | 312 | .cpu_arch = .riscv64, |
| 254 | .os_tag = .linux, | 313 | .os_tag = .linux, |
| ... | @@ -256,7 +315,7 @@ const test_targets = blk: { | ... | @@ -256,7 +315,7 @@ const test_targets = blk: { |
| 256 | }, | 315 | }, |
| 257 | }, | 316 | }, |
| 258 | | 317 | |
| 259 | TestTarget{ | 318 | .{ |
| 260 | .target = .{ | 319 | .target = .{ |
| 261 | .cpu_arch = .riscv64, | 320 | .cpu_arch = .riscv64, |
| 262 | .os_tag = .linux, | 321 | .os_tag = .linux, |
| ... | @@ -266,7 +325,7 @@ const test_targets = blk: { | ... | @@ -266,7 +325,7 @@ const test_targets = blk: { |
| 266 | }, | 325 | }, |
| 267 | | 326 | |
| 268 | // https://github.com/ziglang/zig/issues/3340 | 327 | // https://github.com/ziglang/zig/issues/3340 |
| 269 | //TestTarget{ | 328 | //.{ |
| 270 | // .target = .{ | 329 | // .target = .{ |
| 271 | // .cpu_arch = .riscv64, | 330 | // .cpu_arch = .riscv64, |
| 272 | // .os = .linux, | 331 | // .os = .linux, |
| ... | @@ -275,7 +334,7 @@ const test_targets = blk: { | ... | @@ -275,7 +334,7 @@ const test_targets = blk: { |
| 275 | // .link_libc = true, | 334 | // .link_libc = true, |
| 276 | //}, | 335 | //}, |
| 277 | | 336 | |
| 278 | TestTarget{ | 337 | .{ |
| 279 | .target = .{ | 338 | .target = .{ |
| 280 | .cpu_arch = .x86_64, | 339 | .cpu_arch = .x86_64, |
| 281 | .os_tag = .macos, | 340 | .os_tag = .macos, |
| ... | @@ -283,7 +342,7 @@ const test_targets = blk: { | ... | @@ -283,7 +342,7 @@ const test_targets = blk: { |
| 283 | }, | 342 | }, |
| 284 | }, | 343 | }, |
| 285 | | 344 | |
| 286 | TestTarget{ | 345 | .{ |
| 287 | .target = .{ | 346 | .target = .{ |
| 288 | .cpu_arch = .aarch64, | 347 | .cpu_arch = .aarch64, |
| 289 | .os_tag = .macos, | 348 | .os_tag = .macos, |
| ... | @@ -291,7 +350,7 @@ const test_targets = blk: { | ... | @@ -291,7 +350,7 @@ const test_targets = blk: { |
| 291 | }, | 350 | }, |
| 292 | }, | 351 | }, |
| 293 | | 352 | |
| 294 | TestTarget{ | 353 | .{ |
| 295 | .target = .{ | 354 | .target = .{ |
| 296 | .cpu_arch = .i386, | 355 | .cpu_arch = .i386, |
| 297 | .os_tag = .windows, | 356 | .os_tag = .windows, |
| ... | @@ -299,7 +358,7 @@ const test_targets = blk: { | ... | @@ -299,7 +358,7 @@ const test_targets = blk: { |
| 299 | }, | 358 | }, |
| 300 | }, | 359 | }, |
| 301 | | 360 | |
| 302 | TestTarget{ | 361 | .{ |
| 303 | .target = .{ | 362 | .target = .{ |
| 304 | .cpu_arch = .x86_64, | 363 | .cpu_arch = .x86_64, |
| 305 | .os_tag = .windows, | 364 | .os_tag = .windows, |
| ... | @@ -307,7 +366,7 @@ const test_targets = blk: { | ... | @@ -307,7 +366,7 @@ const test_targets = blk: { |
| 307 | }, | 366 | }, |
| 308 | }, | 367 | }, |
| 309 | | 368 | |
| 310 | TestTarget{ | 369 | .{ |
| 311 | .target = .{ | 370 | .target = .{ |
| 312 | .cpu_arch = .i386, | 371 | .cpu_arch = .i386, |
| 313 | .os_tag = .windows, | 372 | .os_tag = .windows, |
| ... | @@ -316,7 +375,7 @@ const test_targets = blk: { | ... | @@ -316,7 +375,7 @@ const test_targets = blk: { |
| 316 | .link_libc = true, | 375 | .link_libc = true, |
| 317 | }, | 376 | }, |
| 318 | | 377 | |
| 319 | TestTarget{ | 378 | .{ |
| 320 | .target = .{ | 379 | .target = .{ |
| 321 | .cpu_arch = .x86_64, | 380 | .cpu_arch = .x86_64, |
| 322 | .os_tag = .windows, | 381 | .os_tag = .windows, |
| ... | @@ -326,38 +385,38 @@ const test_targets = blk: { | ... | @@ -326,38 +385,38 @@ const test_targets = blk: { |
| 326 | }, | 385 | }, |
| 327 | | 386 | |
| 328 | // Do the release tests last because they take a long time | 387 | // Do the release tests last because they take a long time |
| 329 | TestTarget{ | 388 | .{ |
| 330 | .mode = .ReleaseFast, | 389 | .mode = .ReleaseFast, |
| 331 | }, | 390 | }, |
| 332 | TestTarget{ | 391 | .{ |
| 333 | .link_libc = true, | 392 | .link_libc = true, |
| 334 | .mode = .ReleaseFast, | 393 | .mode = .ReleaseFast, |
| 335 | }, | 394 | }, |
| 336 | TestTarget{ | 395 | .{ |
| 337 | .mode = .ReleaseFast, | 396 | .mode = .ReleaseFast, |
| 338 | .single_threaded = true, | 397 | .single_threaded = true, |
| 339 | }, | 398 | }, |
| 340 | | 399 | |
| 341 | TestTarget{ | 400 | .{ |
| 342 | .mode = .ReleaseSafe, | 401 | .mode = .ReleaseSafe, |
| 343 | }, | 402 | }, |
| 344 | TestTarget{ | 403 | .{ |
| 345 | .link_libc = true, | 404 | .link_libc = true, |
| 346 | .mode = .ReleaseSafe, | 405 | .mode = .ReleaseSafe, |
| 347 | }, | 406 | }, |
| 348 | TestTarget{ | 407 | .{ |
| 349 | .mode = .ReleaseSafe, | 408 | .mode = .ReleaseSafe, |
| 350 | .single_threaded = true, | 409 | .single_threaded = true, |
| 351 | }, | 410 | }, |
| 352 | | 411 | |
| 353 | TestTarget{ | 412 | .{ |
| 354 | .mode = .ReleaseSmall, | 413 | .mode = .ReleaseSmall, |
| 355 | }, | 414 | }, |
| 356 | TestTarget{ | 415 | .{ |
| 357 | .link_libc = true, | 416 | .link_libc = true, |
| 358 | .mode = .ReleaseSmall, | 417 | .mode = .ReleaseSmall, |
| 359 | }, | 418 | }, |
| 360 | TestTarget{ | 419 | .{ |
| 361 | .mode = .ReleaseSmall, | 420 | .mode = .ReleaseSmall, |
| 362 | .single_threaded = true, | 421 | .single_threaded = true, |
| 363 | }, | 422 | }, |
| ... | @@ -524,6 +583,9 @@ pub fn addPkgTests( | ... | @@ -524,6 +583,9 @@ pub fn addPkgTests( |
| 524 | skip_single_threaded: bool, | 583 | skip_single_threaded: bool, |
| 525 | skip_non_native: bool, | 584 | skip_non_native: bool, |
| 526 | skip_libc: bool, | 585 | skip_libc: bool, |
| | 586 | skip_stage1: bool, |
| | 587 | skip_stage2: bool, |
| | 588 | is_stage1: bool, |
| 527 | ) *build.Step { | 589 | ) *build.Step { |
| 528 | const step = b.step(b.fmt("test-{s}", .{name}), desc); | 590 | const step = b.step(b.fmt("test-{s}", .{name}), desc); |
| 529 | | 591 | |
| ... | @@ -549,6 +611,11 @@ pub fn addPkgTests( | ... | @@ -549,6 +611,11 @@ pub fn addPkgTests( |
| 549 | continue; | 611 | continue; |
| 550 | } | 612 | } |
| 551 | | 613 | |
| | 614 | if (test_target.backend) |backend| switch (backend) { |
| | 615 | .stage1 => if (skip_stage1) continue, |
| | 616 | else => if (skip_stage2) continue, |
| | 617 | } else if (is_stage1 and skip_stage1) continue; |
| | 618 | |
| 552 | const want_this_mode = for (modes) |m| { | 619 | const want_this_mode = for (modes) |m| { |
| 553 | if (m == test_target.mode) break true; | 620 | if (m == test_target.mode) break true; |
| 554 | } else false; | 621 | } else false; |
| ... | @@ -565,12 +632,14 @@ pub fn addPkgTests( | ... | @@ -565,12 +632,14 @@ pub fn addPkgTests( |
| 565 | | 632 | |
| 566 | const these_tests = b.addTest(root_src); | 633 | const these_tests = b.addTest(root_src); |
| 567 | const single_threaded_txt = if (test_target.single_threaded) "single" else "multi"; | 634 | const single_threaded_txt = if (test_target.single_threaded) "single" else "multi"; |
| 568 | these_tests.setNamePrefix(b.fmt("{s}-{s}-{s}-{s}-{s} ", .{ | 635 | const backend_txt = if (test_target.backend) |backend| @tagName(backend) else "default"; |
| | 636 | these_tests.setNamePrefix(b.fmt("{s}-{s}-{s}-{s}-{s}-{s} ", .{ |
| 569 | name, | 637 | name, |
| 570 | triple_prefix, | 638 | triple_prefix, |
| 571 | @tagName(test_target.mode), | 639 | @tagName(test_target.mode), |
| 572 | libc_prefix, | 640 | libc_prefix, |
| 573 | single_threaded_txt, | 641 | single_threaded_txt, |
| | 642 | backend_txt, |
| 574 | })); | 643 | })); |
| 575 | these_tests.single_threaded = test_target.single_threaded; | 644 | these_tests.single_threaded = test_target.single_threaded; |
| 576 | these_tests.setFilter(test_filter); | 645 | these_tests.setFilter(test_filter); |
| ... | @@ -581,6 +650,24 @@ pub fn addPkgTests( | ... | @@ -581,6 +650,24 @@ pub fn addPkgTests( |
| 581 | } | 650 | } |
| 582 | these_tests.overrideZigLibDir("lib"); | 651 | these_tests.overrideZigLibDir("lib"); |
| 583 | these_tests.addIncludePath("test"); | 652 | these_tests.addIncludePath("test"); |
| | 653 | if (test_target.backend) |backend| switch (backend) { |
| | 654 | .stage1 => { |
| | 655 | these_tests.use_stage1 = true; |
| | 656 | }, |
| | 657 | .stage2_llvm => { |
| | 658 | these_tests.use_stage1 = false; |
| | 659 | these_tests.use_llvm = true; |
| | 660 | }, |
| | 661 | .stage2_c => { |
| | 662 | these_tests.use_stage1 = false; |
| | 663 | these_tests.use_llvm = false; |
| | 664 | these_tests.ofmt = .c; |
| | 665 | }, |
| | 666 | else => { |
| | 667 | these_tests.use_stage1 = false; |
| | 668 | these_tests.use_llvm = false; |
| | 669 | }, |
| | 670 | }; |
| 584 | | 671 | |
| 585 | step.dependOn(&these_tests.step); | 672 | step.dependOn(&these_tests.step); |
| 586 | } | 673 | } |