@@ -75,6 +75,11 @@ while [[ $# -gt 0 ]]; do
75
75
shift
76
76
;;
77
77
78
+ " --asm-tests" )
79
+ funcs+=(asm_tests)
80
+ shift
81
+ ;;
82
+
78
83
" --extended-tests" )
79
84
funcs+=(extended_sysroot_tests)
80
85
shift
@@ -197,6 +202,40 @@ function std_tests() {
197
202
$RUSTC example/mod_bench.rs --crate-type bin --target $TARGET_TRIPLE
198
203
}
199
204
205
+ function setup_rustc() {
206
+ rust_toolchain=$( cat rust-toolchain | grep channel | sed ' s/channel = "\(.*\)"/\1/' )
207
+
208
+ git clone https://github.com/rust-lang/rust.git || true
209
+ cd rust
210
+ git fetch
211
+ git checkout $( rustc -V | cut -d' ' -f3 | tr -d ' (' )
212
+ export RUSTFLAGS=
213
+
214
+ rm config.toml || true
215
+
216
+ cat > config.toml << EOF
217
+ [rust]
218
+ codegen-backends = []
219
+ deny-warnings = false
220
+
221
+ [build]
222
+ cargo = "$( which cargo) "
223
+ local-rebuild = true
224
+ rustc = "$HOME /.rustup/toolchains/$rust_toolchain -$TARGET_TRIPLE /bin/rustc"
225
+ EOF
226
+
227
+ rustc -V | cut -d' ' -f3 | tr -d ' ('
228
+ git checkout $( rustc -V | cut -d' ' -f3 | tr -d ' (' ) src/test
229
+ }
230
+
231
+ function asm_tests() {
232
+ setup_rustc
233
+
234
+ echo " [TEST] rustc test suite"
235
+ RUSTC_ARGS=" -Zpanic-abort-tests -Csymbol-mangling-version=v0 -Zcodegen-backend=" $( pwd) " /../target/" $CHANNEL " /librustc_codegen_gcc." $dylib_ext " --sysroot " $( pwd) " /../build_sysroot/sysroot -Cpanic=abort"
236
+ COMPILETEST_FORCE_STAGE0=1 ./x.py test --run always --stage 0 src/test/assembly/asm --rustc-args " $RUSTC_ARGS "
237
+ }
238
+
200
239
# FIXME(antoyo): linker gives multiple definitions error on Linux
201
240
# echo "[BUILD] sysroot in release mode"
202
241
# ./build_sysroot/build_sysroot.sh --release
@@ -288,29 +327,7 @@ function test_rustc() {
288
327
echo
289
328
echo " [TEST] rust-lang/rust"
290
329
291
- rust_toolchain=$( cat rust-toolchain | grep channel | sed ' s/channel = "\(.*\)"/\1/' )
292
-
293
- git clone https://github.com/rust-lang/rust.git || true
294
- cd rust
295
- git fetch
296
- git checkout $( rustc -V | cut -d' ' -f3 | tr -d ' (' )
297
- export RUSTFLAGS=
298
-
299
- rm config.toml || true
300
-
301
- cat > config.toml << EOF
302
- [rust]
303
- codegen-backends = []
304
- deny-warnings = false
305
-
306
- [build]
307
- cargo = "$( which cargo) "
308
- local-rebuild = true
309
- rustc = "$HOME /.rustup/toolchains/$rust_toolchain -$TARGET_TRIPLE /bin/rustc"
310
- EOF
311
-
312
- rustc -V | cut -d' ' -f3 | tr -d ' ('
313
- git checkout $( rustc -V | cut -d' ' -f3 | tr -d ' (' ) src/test
330
+ setup_rustc
314
331
315
332
for test in $( rg -i --files-with-matches " //(\[\w+\])?~|// error-pattern:|// build-fail|// run-fail|-Cllvm-args" src/test/ui) ; do
316
333
rm $test
@@ -380,6 +397,7 @@ function all() {
380
397
mini_tests
381
398
build_sysroot
382
399
std_tests
400
+ asm_tests
383
401
test_libcore
384
402
extended_sysroot_tests
385
403
test_rustc
0 commit comments