From dab317f04f33358ff265123db6a27e43f30e2a33 Mon Sep 17 00:00:00 2001 From: "dragan.mladjenovic" Date: Tue, 3 Apr 2018 16:40:05 +0200 Subject: [PATCH 1/3] Small nits to make couple of tests pass on mips targets. --- src/test/codegen/link_section.rs | 6 ++++++ src/test/ui/asm-out-assign-imm.rs | 1 + src/test/ui/target-feature-wrong.rs | 1 + 3 files changed, 8 insertions(+) diff --git a/src/test/codegen/link_section.rs b/src/test/codegen/link_section.rs index 9c56a316b341..415ee6eb7eab 100644 --- a/src/test/codegen/link_section.rs +++ b/src/test/codegen/link_section.rs @@ -15,8 +15,14 @@ // CHECK: @VAR1 = constant <{ [4 x i8] }> <{ [4 x i8] c"\01\00\00\00" }>, section ".test_one" #[no_mangle] #[link_section = ".test_one"] +#[cfg(target_endian = "little")] pub static VAR1: u32 = 1; +#[no_mangle] +#[link_section = ".test_one"] +#[cfg(target_endian = "big")] +pub static VAR1: u32 = 0x01000000; + pub enum E { A(u32), B(f32) diff --git a/src/test/ui/asm-out-assign-imm.rs b/src/test/ui/asm-out-assign-imm.rs index 49084e01a15d..055a169deda7 100644 --- a/src/test/ui/asm-out-assign-imm.rs +++ b/src/test/ui/asm-out-assign-imm.rs @@ -12,6 +12,7 @@ // ignore-emscripten // ignore-powerpc // ignore-sparc +// ignore-mips #![feature(asm)] diff --git a/src/test/ui/target-feature-wrong.rs b/src/test/ui/target-feature-wrong.rs index 56acbed47210..080971f03474 100644 --- a/src/test/ui/target-feature-wrong.rs +++ b/src/test/ui/target-feature-wrong.rs @@ -12,6 +12,7 @@ // ignore-aarch64 // ignore-wasm // ignore-emscripten +// ignore-mips #![feature(target_feature)] From 1e5145db9fcfea306e3c38aeb6625a394c51a5cd Mon Sep 17 00:00:00 2001 From: "dragan.mladjenovic" Date: Thu, 5 Apr 2018 15:30:41 +0200 Subject: [PATCH 2/3] Update ui test references. --- src/test/ui/asm-out-assign-imm.stderr | 2 +- src/test/ui/target-feature-wrong.stderr | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test/ui/asm-out-assign-imm.stderr b/src/test/ui/asm-out-assign-imm.stderr index 4ec758b97f2d..d9fd4b26c390 100644 --- a/src/test/ui/asm-out-assign-imm.stderr +++ b/src/test/ui/asm-out-assign-imm.stderr @@ -1,5 +1,5 @@ error[E0384]: cannot assign twice to immutable variable `x` - --> $DIR/asm-out-assign-imm.rs:29:9 + --> $DIR/asm-out-assign-imm.rs:30:9 | LL | x = 1; | ----- first assignment to `x` diff --git a/src/test/ui/target-feature-wrong.stderr b/src/test/ui/target-feature-wrong.stderr index 8773f8504cb0..fb3fb3553138 100644 --- a/src/test/ui/target-feature-wrong.stderr +++ b/src/test/ui/target-feature-wrong.stderr @@ -1,35 +1,35 @@ warning: #[target_feature = ".."] is deprecated and will eventually be removed, use #[target_feature(enable = "..")] instead - --> $DIR/target-feature-wrong.rs:18:1 + --> $DIR/target-feature-wrong.rs:19:1 | LL | #[target_feature = "+sse2"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: the feature named `foo` is not valid for this target - --> $DIR/target-feature-wrong.rs:20:18 + --> $DIR/target-feature-wrong.rs:21:18 | LL | #[target_feature(enable = "foo")] | ^^^^^^^^^^^^^^ error: #[target_feature(..)] only accepts sub-keys of `enable` currently - --> $DIR/target-feature-wrong.rs:22:18 + --> $DIR/target-feature-wrong.rs:23:18 | LL | #[target_feature(bar)] | ^^^ error: #[target_feature(..)] only accepts sub-keys of `enable` currently - --> $DIR/target-feature-wrong.rs:24:18 + --> $DIR/target-feature-wrong.rs:25:18 | LL | #[target_feature(disable = "baz")] | ^^^^^^^^^^^^^^^ error: #[target_feature(..)] can only be applied to `unsafe` function - --> $DIR/target-feature-wrong.rs:28:1 + --> $DIR/target-feature-wrong.rs:29:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: attribute should be applied to a function - --> $DIR/target-feature-wrong.rs:32:1 + --> $DIR/target-feature-wrong.rs:33:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From 0a94344fa795795de9eb864a75b3d999c2d6ea29 Mon Sep 17 00:00:00 2001 From: "dragan.mladjenovic" Date: Tue, 10 Apr 2018 10:19:58 +0200 Subject: [PATCH 3/3] Add ignores for powerpc and s390x to target-feature-wrong.rs and update references. --- src/test/ui/target-feature-wrong.rs | 2 ++ src/test/ui/target-feature-wrong.stderr | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/test/ui/target-feature-wrong.rs b/src/test/ui/target-feature-wrong.rs index 080971f03474..eb83ee724c78 100644 --- a/src/test/ui/target-feature-wrong.rs +++ b/src/test/ui/target-feature-wrong.rs @@ -13,6 +13,8 @@ // ignore-wasm // ignore-emscripten // ignore-mips +// ignore-powerpc +// ignore-s390x #![feature(target_feature)] diff --git a/src/test/ui/target-feature-wrong.stderr b/src/test/ui/target-feature-wrong.stderr index fb3fb3553138..b5e650eaf9ac 100644 --- a/src/test/ui/target-feature-wrong.stderr +++ b/src/test/ui/target-feature-wrong.stderr @@ -1,35 +1,35 @@ warning: #[target_feature = ".."] is deprecated and will eventually be removed, use #[target_feature(enable = "..")] instead - --> $DIR/target-feature-wrong.rs:19:1 + --> $DIR/target-feature-wrong.rs:21:1 | LL | #[target_feature = "+sse2"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: the feature named `foo` is not valid for this target - --> $DIR/target-feature-wrong.rs:21:18 + --> $DIR/target-feature-wrong.rs:23:18 | LL | #[target_feature(enable = "foo")] | ^^^^^^^^^^^^^^ error: #[target_feature(..)] only accepts sub-keys of `enable` currently - --> $DIR/target-feature-wrong.rs:23:18 + --> $DIR/target-feature-wrong.rs:25:18 | LL | #[target_feature(bar)] | ^^^ error: #[target_feature(..)] only accepts sub-keys of `enable` currently - --> $DIR/target-feature-wrong.rs:25:18 + --> $DIR/target-feature-wrong.rs:27:18 | LL | #[target_feature(disable = "baz")] | ^^^^^^^^^^^^^^^ error: #[target_feature(..)] can only be applied to `unsafe` function - --> $DIR/target-feature-wrong.rs:29:1 + --> $DIR/target-feature-wrong.rs:31:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: attribute should be applied to a function - --> $DIR/target-feature-wrong.rs:33:1 + --> $DIR/target-feature-wrong.rs:35:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -38,7 +38,7 @@ LL | mod another {} | -------------- not a function error: cannot use #[inline(always)] with #[target_feature] - --> $DIR/target-feature-wrong.rs:36:1 + --> $DIR/target-feature-wrong.rs:39:1 | LL | #[inline(always)] | ^^^^^^^^^^^^^^^^^