From 2bc3f5b05352d1a046dc159db52505a25f1f2540 Mon Sep 17 00:00:00 2001 From: James Cowgill Date: Tue, 23 Jan 2018 16:49:08 +0000 Subject: [PATCH 1/9] borrowck-asm: enable on mips --- src/test/compile-fail/borrowck/borrowck-asm.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/compile-fail/borrowck/borrowck-asm.rs b/src/test/compile-fail/borrowck/borrowck-asm.rs index 6bccc83868093..9ad3a8f9fc867 100644 --- a/src/test/compile-fail/borrowck/borrowck-asm.rs +++ b/src/test/compile-fail/borrowck/borrowck-asm.rs @@ -21,7 +21,9 @@ #[cfg(any(target_arch = "x86", target_arch = "x86_64", target_arch = "arm", - target_arch = "aarch64"))] + target_arch = "aarch64", + target_arch = "mips", + target_arch = "mips64"))] mod test_cases { fn is_move() { let y: &mut isize; From 1376bf8b01f8d121b04902ac3ed6a248c5137720 Mon Sep 17 00:00:00 2001 From: James Cowgill Date: Thu, 25 Jan 2018 13:25:37 +0000 Subject: [PATCH 2/9] tools/compiletest: add mips64 to ARCH_LIST Don't bother distinguishing between big end little endian targets. There are currently no tests which need this. --- src/tools/compiletest/src/util.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/compiletest/src/util.rs b/src/tools/compiletest/src/util.rs index cf63cb2e5d901..0e3fa25b13ce9 100644 --- a/src/tools/compiletest/src/util.rs +++ b/src/tools/compiletest/src/util.rs @@ -40,6 +40,7 @@ const ARCH_TABLE: &'static [(&'static str, &'static str)] = &[ ("i386", "x86"), ("i586", "x86"), ("i686", "x86"), + ("mips64", "mips64"), ("mips", "mips"), ("msp430", "msp430"), ("powerpc", "powerpc"), From 6f55819a1e6af80a4bec25dacf9391d81cc78652 Mon Sep 17 00:00:00 2001 From: James Cowgill Date: Thu, 25 Jan 2018 13:26:33 +0000 Subject: [PATCH 3/9] test: remove useless ignore-mips*el headers --- src/test/codegen/fastcall-inreg.rs | 2 -- src/test/codegen/global_asm.rs | 2 -- src/test/codegen/global_asm_include.rs | 2 -- src/test/codegen/global_asm_x2.rs | 2 -- 4 files changed, 8 deletions(-) diff --git a/src/test/codegen/fastcall-inreg.rs b/src/test/codegen/fastcall-inreg.rs index b24899cc363a0..9bfe47d0a1f28 100644 --- a/src/test/codegen/fastcall-inreg.rs +++ b/src/test/codegen/fastcall-inreg.rs @@ -21,9 +21,7 @@ // ignore-bpfeb // ignore-hexagon // ignore-mips -// ignore-mipsel // ignore-mips64 -// ignore-mips64el // ignore-msp430 // ignore-powerpc // ignore-r600 diff --git a/src/test/codegen/global_asm.rs b/src/test/codegen/global_asm.rs index 5661592d0c7b2..94b69a6cab583 100644 --- a/src/test/codegen/global_asm.rs +++ b/src/test/codegen/global_asm.rs @@ -17,9 +17,7 @@ // ignore-bpfeb // ignore-hexagon // ignore-mips -// ignore-mipsel // ignore-mips64 -// ignore-mips64el // ignore-msp430 // ignore-powerpc // ignore-r600 diff --git a/src/test/codegen/global_asm_include.rs b/src/test/codegen/global_asm_include.rs index d8b5db12404ac..c3688077f221b 100644 --- a/src/test/codegen/global_asm_include.rs +++ b/src/test/codegen/global_asm_include.rs @@ -17,9 +17,7 @@ // ignore-bpfeb // ignore-hexagon // ignore-mips -// ignore-mipsel // ignore-mips64 -// ignore-mips64el // ignore-msp430 // ignore-powerpc // ignore-r600 diff --git a/src/test/codegen/global_asm_x2.rs b/src/test/codegen/global_asm_x2.rs index caa0506550dde..3b8fe43fa048a 100644 --- a/src/test/codegen/global_asm_x2.rs +++ b/src/test/codegen/global_asm_x2.rs @@ -17,9 +17,7 @@ // ignore-bpfeb // ignore-hexagon // ignore-mips -// ignore-mipsel // ignore-mips64 -// ignore-mips64el // ignore-msp430 // ignore-powerpc // ignore-r600 From dcc438d633f4f82467ce6408d05404959bb5dc43 Mon Sep 17 00:00:00 2001 From: James Cowgill Date: Thu, 25 Jan 2018 13:28:17 +0000 Subject: [PATCH 4/9] test: ignore mips64 in abi-main-signature-16bit-c-int.rs --- src/test/codegen/abi-main-signature-16bit-c-int.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/codegen/abi-main-signature-16bit-c-int.rs b/src/test/codegen/abi-main-signature-16bit-c-int.rs index 1e02fe4befdf5..707531bf376a7 100644 --- a/src/test/codegen/abi-main-signature-16bit-c-int.rs +++ b/src/test/codegen/abi-main-signature-16bit-c-int.rs @@ -17,6 +17,7 @@ // ignore-asmjs // ignore-hexagon // ignore-mips +// ignore-mips64 // ignore-powerpc // ignore-s390x // ignore-sparc From 59199ebe51d44e120dfd3f75dbcaf154afb70e13 Mon Sep 17 00:00:00 2001 From: James Cowgill Date: Fri, 9 Mar 2018 10:04:27 +0000 Subject: [PATCH 5/9] test: remove duplicate ignore-aarch64 from stack-probes test --- src/test/codegen/stack-probes.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/codegen/stack-probes.rs b/src/test/codegen/stack-probes.rs index 4a489f1edb3b8..45bcedd866f9b 100644 --- a/src/test/codegen/stack-probes.rs +++ b/src/test/codegen/stack-probes.rs @@ -11,7 +11,6 @@ // ignore-arm // ignore-aarch64 // ignore-powerpc -// ignore-aarch64 // ignore-wasm // ignore-emscripten // ignore-windows From bceb94e8b7ba7efbeed95e080a753826cb18e89b Mon Sep 17 00:00:00 2001 From: James Cowgill Date: Fri, 9 Mar 2018 10:05:05 +0000 Subject: [PATCH 6/9] test: ignore stack probe tests on mips* --- src/test/codegen/stack-probes.rs | 2 ++ src/test/run-pass/stack-probes-lto.rs | 2 ++ src/test/run-pass/stack-probes.rs | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/test/codegen/stack-probes.rs b/src/test/codegen/stack-probes.rs index 45bcedd866f9b..af400ff3bcbd0 100644 --- a/src/test/codegen/stack-probes.rs +++ b/src/test/codegen/stack-probes.rs @@ -10,6 +10,8 @@ // ignore-arm // ignore-aarch64 +// ignore-mips +// ignore-mips64 // ignore-powerpc // ignore-wasm // ignore-emscripten diff --git a/src/test/run-pass/stack-probes-lto.rs b/src/test/run-pass/stack-probes-lto.rs index 4deced1297bd1..e7fa3bc0a75c5 100644 --- a/src/test/run-pass/stack-probes-lto.rs +++ b/src/test/run-pass/stack-probes-lto.rs @@ -10,6 +10,8 @@ // ignore-arm // ignore-aarch64 +// ignore-mips +// ignore-mips64 // ignore-wasm // ignore-cloudabi no processes // ignore-emscripten no processes diff --git a/src/test/run-pass/stack-probes.rs b/src/test/run-pass/stack-probes.rs index 4224a65ffd7c7..67b3962ee5fb2 100644 --- a/src/test/run-pass/stack-probes.rs +++ b/src/test/run-pass/stack-probes.rs @@ -10,6 +10,8 @@ // ignore-arm // ignore-aarch64 +// ignore-mips +// ignore-mips64 // ignore-wasm // ignore-cloudabi no processes // ignore-emscripten no processes From e0863c5155138abeb2cae8d2b7bbd60dc700eef6 Mon Sep 17 00:00:00 2001 From: James Cowgill Date: Fri, 9 Mar 2018 10:14:33 +0000 Subject: [PATCH 7/9] test: ignore mips* in x86_mmx test --- src/test/codegen/x86_mmx.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/codegen/x86_mmx.rs b/src/test/codegen/x86_mmx.rs index dc9f63c35db2e..30777c6214ec9 100644 --- a/src/test/codegen/x86_mmx.rs +++ b/src/test/codegen/x86_mmx.rs @@ -11,6 +11,8 @@ // ignore-arm // ignore-aarch64 // ignore-emscripten +// ignore-mips +// ignore-mips64 // compile-flags: -O #![feature(repr_simd)] From 54467ae319de2d23819df897d1813e267e4a3097 Mon Sep 17 00:00:00 2001 From: James Cowgill Date: Fri, 9 Mar 2018 10:15:45 +0000 Subject: [PATCH 8/9] test: ignore asm tests on mips* which won't work "mov" is not a valid assembly mnemonic on mips. --- src/test/compile-fail/asm-bad-clobber.rs | 2 ++ src/test/compile-fail/asm-in-bad-modifier.rs | 2 ++ src/test/compile-fail/asm-misplaced-option.rs | 2 ++ src/test/compile-fail/asm-out-no-modifier.rs | 2 ++ src/test/compile-fail/asm-out-read-uninit.rs | 2 ++ 5 files changed, 10 insertions(+) diff --git a/src/test/compile-fail/asm-bad-clobber.rs b/src/test/compile-fail/asm-bad-clobber.rs index b863e90a3b710..aa77e7f46e50d 100644 --- a/src/test/compile-fail/asm-bad-clobber.rs +++ b/src/test/compile-fail/asm-bad-clobber.rs @@ -15,6 +15,8 @@ // ignore-emscripten // ignore-powerpc // ignore-sparc +// ignore-mips +// ignore-mips64 #![feature(asm, rustc_attrs)] diff --git a/src/test/compile-fail/asm-in-bad-modifier.rs b/src/test/compile-fail/asm-in-bad-modifier.rs index cae41332795df..5e9278c7c35fc 100644 --- a/src/test/compile-fail/asm-in-bad-modifier.rs +++ b/src/test/compile-fail/asm-in-bad-modifier.rs @@ -12,6 +12,8 @@ // ignore-emscripten // ignore-powerpc // ignore-sparc +// ignore-mips +// ignore-mips64 #![feature(asm)] diff --git a/src/test/compile-fail/asm-misplaced-option.rs b/src/test/compile-fail/asm-misplaced-option.rs index e634238c6e179..abd55ea101189 100644 --- a/src/test/compile-fail/asm-misplaced-option.rs +++ b/src/test/compile-fail/asm-misplaced-option.rs @@ -15,6 +15,8 @@ // ignore-emscripten // ignore-powerpc // ignore-sparc +// ignore-mips +// ignore-mips64 #![feature(asm, rustc_attrs)] diff --git a/src/test/compile-fail/asm-out-no-modifier.rs b/src/test/compile-fail/asm-out-no-modifier.rs index 2e843ddac8221..55d8970008f9a 100644 --- a/src/test/compile-fail/asm-out-no-modifier.rs +++ b/src/test/compile-fail/asm-out-no-modifier.rs @@ -12,6 +12,8 @@ // ignore-emscripten // ignore-powerpc // ignore-sparc +// ignore-mips +// ignore-mips64 #![feature(asm)] diff --git a/src/test/compile-fail/asm-out-read-uninit.rs b/src/test/compile-fail/asm-out-read-uninit.rs index 02462bf1be7d7..c606c5a80e58d 100644 --- a/src/test/compile-fail/asm-out-read-uninit.rs +++ b/src/test/compile-fail/asm-out-read-uninit.rs @@ -12,6 +12,8 @@ // ignore-emscripten // ignore-powerpc // ignore-sparc +// ignore-mips +// ignore-mips64 // revisions: ast mir //[mir]compile-flags: -Z borrowck=mir From fb806fd9db4012e0697d7d30cd034458e17e9fa0 Mon Sep 17 00:00:00 2001 From: James Cowgill Date: Fri, 9 Mar 2018 10:18:19 +0000 Subject: [PATCH 9/9] test: fix repr-transparent-aggregates test on mips64 Since #47964 was merged, 64-bit mips started passing all structures using 64-bit chunks regardless of their contents. The repr-transparent-aggregates tests needs updating to cope with this. --- .../codegen/repr-transparent-aggregates-2.rs | 1 + .../codegen/repr-transparent-aggregates-3.rs | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 src/test/codegen/repr-transparent-aggregates-3.rs diff --git a/src/test/codegen/repr-transparent-aggregates-2.rs b/src/test/codegen/repr-transparent-aggregates-2.rs index e6374928a5cbf..9605ded569ef6 100644 --- a/src/test/codegen/repr-transparent-aggregates-2.rs +++ b/src/test/codegen/repr-transparent-aggregates-2.rs @@ -12,6 +12,7 @@ // ignore-aarch64 // ignore-asmjs +// ignore-mips64 // ignore-s390x // ignore-wasm // ignore-x86 diff --git a/src/test/codegen/repr-transparent-aggregates-3.rs b/src/test/codegen/repr-transparent-aggregates-3.rs new file mode 100644 index 0000000000000..0c90239c9de8f --- /dev/null +++ b/src/test/codegen/repr-transparent-aggregates-3.rs @@ -0,0 +1,49 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -C no-prepopulate-passes + +// only-mips64 +// See repr-transparent.rs + +#![crate_type="lib"] +#![feature(repr_transparent)] + + +#[repr(C)] +pub struct Big([u32; 16]); + +#[repr(transparent)] +pub struct BigW(Big); + +// CHECK: define void @test_Big(%Big* [[BIG_RET_ATTRS:.*]], [8 x i64] +#[no_mangle] +pub extern fn test_Big(_: Big) -> Big { loop {} } + +// CHECK: define void @test_BigW(%BigW* [[BIG_RET_ATTRS]], [8 x i64] +#[no_mangle] +pub extern fn test_BigW(_: BigW) -> BigW { loop {} } + + +#[repr(C)] +pub union BigU { + foo: [u32; 16], +} + +#[repr(transparent)] +pub struct BigUw(BigU); + +// CHECK: define void @test_BigU(%BigU* [[BIGU_RET_ATTRS:.*]], [8 x i64] +#[no_mangle] +pub extern fn test_BigU(_: BigU) -> BigU { loop {} } + +// CHECK: define void @test_BigUw(%BigUw* [[BIGU_RET_ATTRS]], [8 x i64] +#[no_mangle] +pub extern fn test_BigUw(_: BigUw) -> BigUw { loop {} }