test: ui: skip tests which aren't appropriate for RISC-V

This commit is contained in:
Tom Eccles 2020-05-20 17:35:47 +01:00
parent 627957100c
commit 8edb05c2a0
26 changed files with 60 additions and 42 deletions

View File

@ -3,6 +3,7 @@
// ignore-powerpc
// ignore-powerpc64
// ignore-powerpc64le
// ignore-riscv64
// ignore-sparc
// ignore-sparc64

View File

@ -1,5 +1,5 @@
error[E0382]: use of moved value: `x`
--> $DIR/borrowck-asm.rs:24:17
--> $DIR/borrowck-asm.rs:25:17
|
LL | let x = &mut 0isize;
| - move occurs because `x` has type `&mut isize`, which does not implement the `Copy` trait
@ -11,7 +11,7 @@ LL | let z = x;
| ^ value used here after move
error[E0503]: cannot use `x` because it was mutably borrowed
--> $DIR/borrowck-asm.rs:31:37
--> $DIR/borrowck-asm.rs:32:37
|
LL | let y = &mut x;
| ------ borrow of `x` occurs here
@ -23,7 +23,7 @@ LL | let z = y;
| - borrow later used here
error[E0384]: cannot assign twice to immutable variable `x`
--> $DIR/borrowck-asm.rs:39:36
--> $DIR/borrowck-asm.rs:40:36
|
LL | let x = 3;
| -
@ -35,7 +35,7 @@ LL | llvm_asm!("nop" : "=r"(x));
| ^ cannot assign twice to immutable variable
error[E0384]: cannot assign twice to immutable variable `x`
--> $DIR/borrowck-asm.rs:53:36
--> $DIR/borrowck-asm.rs:54:36
|
LL | let x = 3;
| -
@ -47,13 +47,13 @@ LL | llvm_asm!("nop" : "+r"(x));
| ^ cannot assign twice to immutable variable
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/borrowck-asm.rs:60:37
--> $DIR/borrowck-asm.rs:61:37
|
LL | llvm_asm!("nop" : "=*r"(x));
| ^ use of possibly-uninitialized `x`
error[E0506]: cannot assign to `x` because it is borrowed
--> $DIR/borrowck-asm.rs:68:36
--> $DIR/borrowck-asm.rs:69:36
|
LL | let y = &*x;
| --- borrow of `x` occurs here
@ -65,7 +65,7 @@ LL | let z = y;
| - borrow later used here
error[E0382]: use of moved value: `x`
--> $DIR/borrowck-asm.rs:76:45
--> $DIR/borrowck-asm.rs:77:45
|
LL | let x = &mut 2;
| - move occurs because `x` has type `&mut i32`, which does not implement the `Copy` trait

View File

@ -1,5 +1,6 @@
// ignore-arm stdcall isn't supported
// ignore-aarch64 stdcall isn't supported
// ignore-riscv64 stdcall isn't supported
extern "stdcall" {
fn printf(_: *const u8, ...); //~ ERROR: variadic function must have C or cdecl calling

View File

@ -1,11 +1,11 @@
error[E0045]: C-variadic function must have C or cdecl calling convention
--> $DIR/variadic-ffi-1.rs:5:5
--> $DIR/variadic-ffi-1.rs:6:5
|
LL | fn printf(_: *const u8, ...);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadics require C or cdecl calling convention
error[E0060]: this function takes at least 2 arguments but 0 arguments were supplied
--> $DIR/variadic-ffi-1.rs:16:9
--> $DIR/variadic-ffi-1.rs:17:9
|
LL | fn foo(f: isize, x: u8, ...);
| ----------------------------- defined here
@ -16,7 +16,7 @@ LL | foo();
| expected at least 2 arguments
error[E0060]: this function takes at least 2 arguments but 1 argument was supplied
--> $DIR/variadic-ffi-1.rs:17:9
--> $DIR/variadic-ffi-1.rs:18:9
|
LL | fn foo(f: isize, x: u8, ...);
| ----------------------------- defined here
@ -27,7 +27,7 @@ LL | foo(1);
| expected at least 2 arguments
error[E0308]: mismatched types
--> $DIR/variadic-ffi-1.rs:19:56
--> $DIR/variadic-ffi-1.rs:20:56
|
LL | let x: unsafe extern "C" fn(f: isize, x: u8) = foo;
| ------------------------------------- ^^^ expected non-variadic fn, found variadic function
@ -38,7 +38,7 @@ LL | let x: unsafe extern "C" fn(f: isize, x: u8) = foo;
found fn item `unsafe extern "C" fn(_, _, ...) {foo}`
error[E0308]: mismatched types
--> $DIR/variadic-ffi-1.rs:20:54
--> $DIR/variadic-ffi-1.rs:21:54
|
LL | let y: extern "C" fn(f: isize, x: u8, ...) = bar;
| ----------------------------------- ^^^ expected variadic fn, found non-variadic function
@ -49,37 +49,37 @@ LL | let y: extern "C" fn(f: isize, x: u8, ...) = bar;
found fn item `extern "C" fn(_, _) {bar}`
error[E0617]: can't pass `f32` to variadic function
--> $DIR/variadic-ffi-1.rs:22:19
--> $DIR/variadic-ffi-1.rs:23:19
|
LL | foo(1, 2, 3f32);
| ^^^^ help: cast the value to `c_double`: `3f32 as c_double`
error[E0617]: can't pass `bool` to variadic function
--> $DIR/variadic-ffi-1.rs:23:19
--> $DIR/variadic-ffi-1.rs:24:19
|
LL | foo(1, 2, true);
| ^^^^ help: cast the value to `c_int`: `true as c_int`
error[E0617]: can't pass `i8` to variadic function
--> $DIR/variadic-ffi-1.rs:24:19
--> $DIR/variadic-ffi-1.rs:25:19
|
LL | foo(1, 2, 1i8);
| ^^^ help: cast the value to `c_int`: `1i8 as c_int`
error[E0617]: can't pass `u8` to variadic function
--> $DIR/variadic-ffi-1.rs:25:19
--> $DIR/variadic-ffi-1.rs:26:19
|
LL | foo(1, 2, 1u8);
| ^^^ help: cast the value to `c_uint`: `1u8 as c_uint`
error[E0617]: can't pass `i16` to variadic function
--> $DIR/variadic-ffi-1.rs:26:19
--> $DIR/variadic-ffi-1.rs:27:19
|
LL | foo(1, 2, 1i16);
| ^^^^ help: cast the value to `c_int`: `1i16 as c_int`
error[E0617]: can't pass `u16` to variadic function
--> $DIR/variadic-ffi-1.rs:27:19
--> $DIR/variadic-ffi-1.rs:28:19
|
LL | foo(1, 2, 1u16);
| ^^^^ help: cast the value to `c_uint`: `1u16 as c_uint`

View File

@ -36,3 +36,6 @@ pub fn main() { }
#[cfg(target_arch = "sparc64")]
pub fn main() { }
#[cfg(target_arch = "riscv64")]
pub fn main() { }

View File

@ -1,6 +1,7 @@
// run-pass
// ignore-arm
// ignore-aarch64
// ignore-riscv64 fastcall isn't supported
trait A {
extern "fastcall" fn test1(i: i32);

View File

@ -1,6 +1,7 @@
// run-pass
// ignore-arm
// ignore-aarch64
// ignore-riscv64 thiscall isn't supported
#![feature(abi_thiscall)]

View File

@ -1,6 +1,7 @@
// run-pass
// ignore-arm
// ignore-aarch64
// ignore-riscv64 vectorcall isn't supported
#![feature(abi_vectorcall)]

View File

@ -1,6 +1,8 @@
// Test that the MSP430 interrupt ABI cannot be used when msp430_interrupt
// feature gate is not used.
// ignore-riscv64 msp430 is not supported
extern "msp430-interrupt" fn foo() {}
//~^ ERROR msp430-interrupt ABI is experimental and subject to change

View File

@ -1,5 +1,5 @@
error[E0658]: msp430-interrupt ABI is experimental and subject to change
--> $DIR/feature-gate-abi-msp430-interrupt.rs:4:8
--> $DIR/feature-gate-abi-msp430-interrupt.rs:6:8
|
LL | extern "msp430-interrupt" fn foo() {}
| ^^^^^^^^^^^^^^^^^^

View File

@ -6,6 +6,7 @@
// ignore-powerpc
// ignore-powerpc64
// ignore-powerpc64le
// ignore-riscv64
// ignore-sparc
// ignore-sparc64
// ignore-mips

View File

@ -1,5 +1,5 @@
error[E0664]: clobber should not be surrounded by braces
--> $DIR/llvm-asm-bad-clobber.rs:22:42
--> $DIR/llvm-asm-bad-clobber.rs:23:42
|
LL | llvm_asm!("xor %eax, %eax" : : : "{eax}");
| ^^^^^^^

View File

@ -3,6 +3,7 @@
// ignore-powerpc
// ignore-powerpc64
// ignore-powerpc64le
// ignore-riscv64
// ignore-sparc
// ignore-sparc64
// ignore-mips

View File

@ -1,11 +1,11 @@
error[E0662]: input operand constraint contains '='
--> $DIR/llvm-asm-in-bad-modifier.rs:23:44
--> $DIR/llvm-asm-in-bad-modifier.rs:24:44
|
LL | llvm_asm!("mov $1, $0" : "=r"(x) : "=r"(5));
| ^^^^
error[E0663]: input operand constraint contains '+'
--> $DIR/llvm-asm-in-bad-modifier.rs:24:44
--> $DIR/llvm-asm-in-bad-modifier.rs:25:44
|
LL | llvm_asm!("mov $1, $0" : "=r"(y) : "+r"(5));
| ^^^^

View File

@ -7,6 +7,7 @@
// ignore-powerpc
// ignore-powerpc64
// ignore-powerpc64le
// ignore-riscv64
// ignore-sparc
// ignore-sparc64
// ignore-mips

View File

@ -1,11 +1,11 @@
warning: unrecognized option
--> $DIR/llvm-asm-misplaced-option.rs:24:69
--> $DIR/llvm-asm-misplaced-option.rs:25:69
|
LL | llvm_asm!("mov $1, $0" : "=r"(x) : "r"(5_usize), "0"(x) : : "cc");
| ^^^^
warning: expected a clobber, found an option
--> $DIR/llvm-asm-misplaced-option.rs:31:85
--> $DIR/llvm-asm-misplaced-option.rs:32:85
|
LL | llvm_asm!("add $2, $1; mov $1, $0" : "=r"(x) : "r"(x), "r"(8_usize) : "cc", "volatile");
| ^^^^^^^^^^

View File

@ -3,6 +3,7 @@
// ignore-powerpc
// ignore-powerpc64
// ignore-powerpc64le
// ignore-riscv64
// ignore-sparc
// ignore-sparc64
// ignore-mips

View File

@ -1,5 +1,5 @@
error[E0384]: cannot assign twice to immutable variable `x`
--> $DIR/llvm-asm-out-assign-imm.rs:24:39
--> $DIR/llvm-asm-out-assign-imm.rs:25:39
|
LL | let x: isize;
| - help: make this binding mutable: `mut x`

View File

@ -3,6 +3,7 @@
// ignore-powerpc
// ignore-powerpc64
// ignore-powerpc64le
// ignore-riscv64
// ignore-sparc
// ignore-sparc64
// ignore-mips

View File

@ -1,5 +1,5 @@
error[E0661]: output operand constraint lacks '=' or '+'
--> $DIR/llvm-asm-out-no-modifier.rs:22:34
--> $DIR/llvm-asm-out-no-modifier.rs:23:34
|
LL | llvm_asm!("mov $1, $0" : "r"(x) : "r"(5));
| ^^^

View File

@ -3,6 +3,7 @@
// ignore-powerpc
// ignore-powerpc64
// ignore-powerpc64le
// ignore-riscv64
// ignore-sparc
// ignore-sparc64
// ignore-mips

View File

@ -1,5 +1,5 @@
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/llvm-asm-out-read-uninit.rs:22:48
--> $DIR/llvm-asm-out-read-uninit.rs:23:48
|
LL | llvm_asm!("mov $1, $0" : "=r"(x) : "r"(x));
| ^ use of possibly-uninitialized `x`

View File

@ -7,6 +7,7 @@
// ignore-powerpc
// ignore-powerpc64
// ignore-powerpc64le
// ignore-riscv64
// ignore-sparc
// ignore-sparc64
// ignore-s390x

View File

@ -1,5 +1,5 @@
error[E0658]: the target feature `avx512bw` is currently unstable
--> $DIR/gate.rs:30:18
--> $DIR/gate.rs:31:18
|
LL | #[target_feature(enable = "avx512bw")]
| ^^^^^^^^^^^^^^^^^^^

View File

@ -7,6 +7,7 @@
// ignore-powerpc
// ignore-powerpc64
// ignore-powerpc64le
// ignore-riscv64
// ignore-s390x
// ignore-sparc
// ignore-sparc64

View File

@ -1,29 +1,29 @@
error: malformed `target_feature` attribute input
--> $DIR/invalid-attribute.rs:16:1
--> $DIR/invalid-attribute.rs:17:1
|
LL | #[target_feature = "+sse2"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[target_feature(enable = "name")]`
error: the feature named `foo` is not valid for this target
--> $DIR/invalid-attribute.rs:18:18
--> $DIR/invalid-attribute.rs:19:18
|
LL | #[target_feature(enable = "foo")]
| ^^^^^^^^^^^^^^ `foo` is not valid for this target
error: malformed `target_feature` attribute input
--> $DIR/invalid-attribute.rs:21:18
--> $DIR/invalid-attribute.rs:22:18
|
LL | #[target_feature(bar)]
| ^^^ help: must be of the form: `enable = ".."`
error: malformed `target_feature` attribute input
--> $DIR/invalid-attribute.rs:23:18
--> $DIR/invalid-attribute.rs:24:18
|
LL | #[target_feature(disable = "baz")]
| ^^^^^^^^^^^^^^^ help: must be of the form: `enable = ".."`
error[E0658]: `#[target_feature(..)]` can only be applied to `unsafe` functions
--> $DIR/invalid-attribute.rs:27:1
--> $DIR/invalid-attribute.rs:28:1
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -35,7 +35,7 @@ LL | fn bar() {}
= help: add `#![feature(target_feature_11)]` to the crate attributes to enable
error: attribute should be applied to a function
--> $DIR/invalid-attribute.rs:33:1
--> $DIR/invalid-attribute.rs:34:1
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -44,7 +44,7 @@ LL | mod another {}
| -------------- not a function
error: attribute should be applied to a function
--> $DIR/invalid-attribute.rs:38:1
--> $DIR/invalid-attribute.rs:39:1
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -53,7 +53,7 @@ LL | const FOO: usize = 7;
| --------------------- not a function
error: attribute should be applied to a function
--> $DIR/invalid-attribute.rs:43:1
--> $DIR/invalid-attribute.rs:44:1
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -62,7 +62,7 @@ LL | struct Foo;
| ----------- not a function
error: attribute should be applied to a function
--> $DIR/invalid-attribute.rs:48:1
--> $DIR/invalid-attribute.rs:49:1
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -71,7 +71,7 @@ LL | enum Bar { }
| ------------ not a function
error: attribute should be applied to a function
--> $DIR/invalid-attribute.rs:53:1
--> $DIR/invalid-attribute.rs:54:1
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -80,7 +80,7 @@ LL | union Qux { f1: u16, f2: u16 }
| ------------------------------ not a function
error: attribute should be applied to a function
--> $DIR/invalid-attribute.rs:58:1
--> $DIR/invalid-attribute.rs:59:1
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -89,13 +89,13 @@ LL | trait Baz { }
| ------------- not a function
error: cannot use `#[inline(always)]` with `#[target_feature]`
--> $DIR/invalid-attribute.rs:63:1
--> $DIR/invalid-attribute.rs:64:1
|
LL | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
error[E0658]: `#[target_feature(..)]` can only be applied to `unsafe` functions
--> $DIR/invalid-attribute.rs:85:5
--> $DIR/invalid-attribute.rs:86:5
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -107,7 +107,7 @@ LL | || {};
= help: add `#![feature(target_feature_11)]` to the crate attributes to enable
error[E0658]: `#[target_feature(..)]` can only be applied to `unsafe` functions
--> $DIR/invalid-attribute.rs:73:5
--> $DIR/invalid-attribute.rs:74:5
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^