]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_codegen_cranelift/scripts/test_rustc_tests.sh
:arrow_up: rust-analyzer
[rust.git] / compiler / rustc_codegen_cranelift / scripts / test_rustc_tests.sh
1 #!/usr/bin/env bash
2 set -e
3
4 cd $(dirname "$0")/../
5
6 source ./scripts/setup_rust_fork.sh
7
8 echo "[TEST] Test suite of rustc"
9 pushd rust
10
11 command -v rg >/dev/null 2>&1 || cargo install ripgrep
12
13 rm -r src/test/ui/{extern/,unsized-locals/,lto/,linkage*} || true
14 for test in $(rg --files-with-matches "lto|// needs-asm-support|// needs-unwind" src/test/{ui,incremental}); do
15   rm $test
16 done
17
18 for test in $(rg -i --files-with-matches "//(\[\w+\])?~[^\|]*\s*ERR|// error-pattern:|// build-fail|// run-fail|-Cllvm-args" src/test/ui); do
19   rm $test
20 done
21
22 git checkout -- src/test/ui/issues/auxiliary/issue-3136-a.rs # contains //~ERROR, but shouldn't be removed
23
24 # missing features
25 # ================
26
27 # requires stack unwinding
28 rm src/test/incremental/change_crate_dep_kind.rs
29 rm src/test/incremental/issue-80691-bad-eval-cache.rs # -Cpanic=abort causes abort instead of exit(101)
30
31 # requires compiling with -Cpanic=unwind
32 rm src/test/ui/test-attrs/test-fn-signature-verification-for-explicit-return-type.rs # "Cannot run dynamic test fn out-of-process"
33 rm src/test/ui/async-await/async-fn-size-moved-locals.rs # -Cpanic=abort shrinks some generator by one byte
34 rm src/test/ui/async-await/async-fn-size-uninit-locals.rs # same
35 rm src/test/ui/generator/size-moved-locals.rs # same
36 rm -r src/test/ui/macros/rfc-2011-nicer-assert-messages/
37
38 # vendor intrinsics
39 rm src/test/ui/sse2.rs # cpuid not supported, so sse2 not detected
40 rm src/test/ui/intrinsics/const-eval-select-x86_64.rs # requires x86_64 vendor intrinsics
41 rm src/test/ui/simd/array-type.rs # "Index argument for `simd_insert` is not a constant"
42 rm src/test/ui/simd/intrinsic/generic-bitmask-pass.rs # simd_bitmask unimplemented
43 rm src/test/ui/simd/intrinsic/generic-as.rs # simd_as unimplemented
44 rm src/test/ui/simd/intrinsic/generic-arithmetic-saturating-pass.rs # simd_saturating_add unimplemented
45 rm src/test/ui/simd/intrinsic/float-math-pass.rs # simd_fcos unimplemented
46 rm src/test/ui/simd/intrinsic/generic-gather-pass.rs # simd_gather unimplemented
47 rm src/test/ui/simd/intrinsic/generic-select-pass.rs # simd_select_bitmask unimplemented
48 rm src/test/ui/simd/issue-85915-simd-ptrs.rs # simd_gather unimplemented
49 rm src/test/ui/simd/issue-89193.rs # simd_gather unimplemented
50 rm src/test/ui/simd/simd-bitmask.rs # simd_bitmask unimplemented
51
52 # exotic linkages
53 rm src/test/ui/issues/issue-33992.rs # unsupported linkages
54 rm src/test/incremental/hashes/function_interfaces.rs # same
55 rm src/test/incremental/hashes/statics.rs # same
56
57 # variadic arguments
58 rm src/test/ui/abi/mir/mir_codegen_calls_variadic.rs # requires float varargs
59 rm src/test/ui/abi/variadic-ffi.rs # requires callee side vararg support
60
61 # unsized locals
62 rm -r src/test/run-pass-valgrind/unsized-locals
63
64 # misc unimplemented things
65 rm src/test/ui/intrinsics/intrinsic-nearby.rs # unimplemented nearbyintf32 and nearbyintf64 intrinsics
66 rm src/test/ui/target-feature/missing-plusminus.rs # error not implemented
67 rm src/test/ui/fn/dyn-fn-alignment.rs # wants a 256 byte alignment
68 rm -r src/test/run-make/emit-named-files # requires full --emit support
69 rm src/test/ui/abi/stack-probes.rs # stack probes not yet implemented
70
71 # optimization tests
72 # ==================
73 rm src/test/ui/codegen/issue-28950.rs # depends on stack size optimizations
74 rm src/test/ui/codegen/init-large-type.rs # same
75 rm src/test/ui/issues/issue-40883.rs # same
76 rm -r src/test/run-make/fmt-write-bloat/ # tests an optimization
77
78 # backend specific tests
79 # ======================
80 rm src/test/incremental/thinlto/cgu_invalidated_when_import_{added,removed}.rs # requires LLVM
81 rm src/test/ui/abi/stack-protector.rs # requires stack protector support
82
83 # giving different but possibly correct results
84 # =============================================
85 rm src/test/ui/mir/mir_misc_casts.rs # depends on deduplication of constants
86 rm src/test/ui/mir/mir_raw_fat_ptr.rs # same
87 rm src/test/ui/consts/issue-33537.rs # same
88
89 # doesn't work due to the way the rustc test suite is invoked.
90 # should work when using ./x.py test the way it is intended
91 # ============================================================
92 rm -r src/test/run-make/emit-shared-files # requires the rustdoc executable in build/bin/
93 rm -r src/test/run-make/unstable-flag-required # same
94 rm -r src/test/run-make/rustdoc-* # same
95 rm -r src/test/run-make/issue-88756-default-output # same
96 rm -r src/test/run-make/remap-path-prefix-dwarf # requires llvm-dwarfdump
97
98 # genuine bugs
99 # ============
100 rm src/test/ui/allocator/no_std-alloc-error-handler-default.rs # missing rust_oom definition
101
102 rm src/test/incremental/spike-neg1.rs # errors out for some reason
103 rm src/test/incremental/spike-neg2.rs # same
104 rm src/test/ui/issues/issue-74564-if-expr-stack-overflow.rs # gives a stackoverflow before the backend runs
105 rm src/test/ui/mir/ssa-analysis-regression-50041.rs # produces ICE
106 rm src/test/ui/type-alias-impl-trait/assoc-projection-ice.rs # produces ICE
107
108 rm src/test/ui/simd/intrinsic/generic-reduction-pass.rs # simd_reduce_add_unordered doesn't accept an accumulator for integer vectors
109
110 # bugs in the test suite
111 # ======================
112 rm src/test/ui/backtrace.rs # TODO warning
113 rm src/test/ui/empty_global_asm.rs # TODO add needs-asm-support
114 rm src/test/ui/simple_global_asm.rs # TODO add needs-asm-support
115 rm src/test/ui/test-attrs/test-type.rs # TODO panic message on stderr. correct stdout
116 # not sure if this is actually a bug in the test suite, but the symbol list shows the function without leading _ for some reason
117 rm -r src/test/run-make/native-link-modifier-bundle
118
119 echo "[TEST] rustc test suite"
120 RUST_TEST_NOCAPTURE=1 COMPILETEST_FORCE_STAGE0=1 ./x.py test --stage 0 src/test/{codegen-units,run-make,run-pass-valgrind,ui,incremental}
121 popd