Update compile-fail tests.

This commit is contained in:
Michael Woerister 2017-10-30 18:19:31 +01:00
parent 9fd4be9c2e
commit 55c3b8ec66
6 changed files with 36 additions and 33 deletions

View File

@ -11,4 +11,6 @@
#[inline()] //~ ERROR E0534 #[inline()] //~ ERROR E0534
pub fn something() {} pub fn something() {}
fn main() {} fn main() {
something();
}

View File

@ -10,6 +10,7 @@
#![feature(repr_simd, platform_intrinsics, core_intrinsics)] #![feature(repr_simd, platform_intrinsics, core_intrinsics)]
#![allow(warnings)] #![allow(warnings)]
#![crate_type = "rlib"]
// Bad monomorphizations could previously cause LLVM asserts even though the // Bad monomorphizations could previously cause LLVM asserts even though the
// error was caught in the compiler. // error was caught in the compiler.
@ -21,21 +22,19 @@ extern "platform-intrinsic" {
use std::intrinsics; use std::intrinsics;
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
struct Foo(i64); pub struct Foo(i64);
unsafe fn test_cttz(v: Foo) -> Foo { pub unsafe fn test_cttz(v: Foo) -> Foo {
intrinsics::cttz(v) intrinsics::cttz(v)
//~^ ERROR `cttz` intrinsic: expected basic integer type, found `Foo` //~^ ERROR `cttz` intrinsic: expected basic integer type, found `Foo`
} }
unsafe fn test_fadd_fast(a: Foo, b: Foo) -> Foo { pub unsafe fn test_fadd_fast(a: Foo, b: Foo) -> Foo {
intrinsics::fadd_fast(a, b) intrinsics::fadd_fast(a, b)
//~^ ERROR `fadd_fast` intrinsic: expected basic float type, found `Foo` //~^ ERROR `fadd_fast` intrinsic: expected basic float type, found `Foo`
} }
unsafe fn test_simd_add(a: Foo, b: Foo) -> Foo { pub unsafe fn test_simd_add(a: Foo, b: Foo) -> Foo {
simd_add(a, b) simd_add(a, b)
//~^ ERROR `simd_add` intrinsic: expected SIMD input type, found non-SIMD `Foo` //~^ ERROR `simd_add` intrinsic: expected SIMD input type, found non-SIMD `Foo`
} }
fn main() {}

View File

@ -11,13 +11,13 @@
#![crate_type="rlib"] #![crate_type="rlib"]
#![allow(warnings)] #![allow(warnings)]
mod a { pub mod a {
#[no_mangle] #[no_mangle]
pub extern fn fail() { pub extern fn fail() {
} }
} }
mod b { pub mod b {
#[no_mangle] #[no_mangle]
pub extern fn fail() { pub extern fn fail() {
//~^ symbol `fail` is already defined //~^ symbol `fail` is already defined

View File

@ -21,4 +21,8 @@ fn b() {
fn c() { fn c() {
} }
fn main() {} fn main() {
a();
b();
c();
}

View File

@ -12,6 +12,7 @@
#![recursion_limit = "20"] #![recursion_limit = "20"]
#![type_length_limit = "20000000"] #![type_length_limit = "20000000"]
#![crate_type = "rlib"]
#[derive(Clone)] #[derive(Clone)]
struct A (B); struct A (B);
@ -66,5 +67,3 @@ impl D {
pub fn matches() { pub fn matches() {
A(B::Variant1).matches(&(|| ())) A(B::Variant1).matches(&(|| ()))
} }
fn main() {}

View File

@ -10,92 +10,91 @@
#![feature(core_intrinsics)] #![feature(core_intrinsics)]
#![allow(warnings)] #![allow(warnings)]
#![crate_type = "rlib"]
use std::intrinsics; use std::intrinsics;
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
struct Foo(i64); pub struct Foo(i64);
type Bar = &'static Fn(); pub type Bar = &'static Fn();
type Quux = [u8; 100]; pub type Quux = [u8; 100];
unsafe fn test_bool_load(p: &mut bool, v: bool) { pub unsafe fn test_bool_load(p: &mut bool, v: bool) {
intrinsics::atomic_load(p); intrinsics::atomic_load(p);
//~^ ERROR `atomic_load` intrinsic: expected basic integer type, found `bool` //~^ ERROR `atomic_load` intrinsic: expected basic integer type, found `bool`
} }
unsafe fn test_bool_store(p: &mut bool, v: bool) { pub unsafe fn test_bool_store(p: &mut bool, v: bool) {
intrinsics::atomic_store(p, v); intrinsics::atomic_store(p, v);
//~^ ERROR `atomic_store` intrinsic: expected basic integer type, found `bool` //~^ ERROR `atomic_store` intrinsic: expected basic integer type, found `bool`
} }
unsafe fn test_bool_xchg(p: &mut bool, v: bool) { pub unsafe fn test_bool_xchg(p: &mut bool, v: bool) {
intrinsics::atomic_xchg(p, v); intrinsics::atomic_xchg(p, v);
//~^ ERROR `atomic_xchg` intrinsic: expected basic integer type, found `bool` //~^ ERROR `atomic_xchg` intrinsic: expected basic integer type, found `bool`
} }
unsafe fn test_bool_cxchg(p: &mut bool, v: bool) { pub unsafe fn test_bool_cxchg(p: &mut bool, v: bool) {
intrinsics::atomic_cxchg(p, v, v); intrinsics::atomic_cxchg(p, v, v);
//~^ ERROR `atomic_cxchg` intrinsic: expected basic integer type, found `bool` //~^ ERROR `atomic_cxchg` intrinsic: expected basic integer type, found `bool`
} }
unsafe fn test_Foo_load(p: &mut Foo, v: Foo) { pub unsafe fn test_Foo_load(p: &mut Foo, v: Foo) {
intrinsics::atomic_load(p); intrinsics::atomic_load(p);
//~^ ERROR `atomic_load` intrinsic: expected basic integer type, found `Foo` //~^ ERROR `atomic_load` intrinsic: expected basic integer type, found `Foo`
} }
unsafe fn test_Foo_store(p: &mut Foo, v: Foo) { pub unsafe fn test_Foo_store(p: &mut Foo, v: Foo) {
intrinsics::atomic_store(p, v); intrinsics::atomic_store(p, v);
//~^ ERROR `atomic_store` intrinsic: expected basic integer type, found `Foo` //~^ ERROR `atomic_store` intrinsic: expected basic integer type, found `Foo`
} }
unsafe fn test_Foo_xchg(p: &mut Foo, v: Foo) { pub unsafe fn test_Foo_xchg(p: &mut Foo, v: Foo) {
intrinsics::atomic_xchg(p, v); intrinsics::atomic_xchg(p, v);
//~^ ERROR `atomic_xchg` intrinsic: expected basic integer type, found `Foo` //~^ ERROR `atomic_xchg` intrinsic: expected basic integer type, found `Foo`
} }
unsafe fn test_Foo_cxchg(p: &mut Foo, v: Foo) { pub unsafe fn test_Foo_cxchg(p: &mut Foo, v: Foo) {
intrinsics::atomic_cxchg(p, v, v); intrinsics::atomic_cxchg(p, v, v);
//~^ ERROR `atomic_cxchg` intrinsic: expected basic integer type, found `Foo` //~^ ERROR `atomic_cxchg` intrinsic: expected basic integer type, found `Foo`
} }
unsafe fn test_Bar_load(p: &mut Bar, v: Bar) { pub unsafe fn test_Bar_load(p: &mut Bar, v: Bar) {
intrinsics::atomic_load(p); intrinsics::atomic_load(p);
//~^ ERROR expected basic integer type, found `&std::ops::Fn()` //~^ ERROR expected basic integer type, found `&std::ops::Fn()`
} }
unsafe fn test_Bar_store(p: &mut Bar, v: Bar) { pub unsafe fn test_Bar_store(p: &mut Bar, v: Bar) {
intrinsics::atomic_store(p, v); intrinsics::atomic_store(p, v);
//~^ ERROR expected basic integer type, found `&std::ops::Fn()` //~^ ERROR expected basic integer type, found `&std::ops::Fn()`
} }
unsafe fn test_Bar_xchg(p: &mut Bar, v: Bar) { pub unsafe fn test_Bar_xchg(p: &mut Bar, v: Bar) {
intrinsics::atomic_xchg(p, v); intrinsics::atomic_xchg(p, v);
//~^ ERROR expected basic integer type, found `&std::ops::Fn()` //~^ ERROR expected basic integer type, found `&std::ops::Fn()`
} }
unsafe fn test_Bar_cxchg(p: &mut Bar, v: Bar) { pub unsafe fn test_Bar_cxchg(p: &mut Bar, v: Bar) {
intrinsics::atomic_cxchg(p, v, v); intrinsics::atomic_cxchg(p, v, v);
//~^ ERROR expected basic integer type, found `&std::ops::Fn()` //~^ ERROR expected basic integer type, found `&std::ops::Fn()`
} }
unsafe fn test_Quux_load(p: &mut Quux, v: Quux) { pub unsafe fn test_Quux_load(p: &mut Quux, v: Quux) {
intrinsics::atomic_load(p); intrinsics::atomic_load(p);
//~^ ERROR `atomic_load` intrinsic: expected basic integer type, found `[u8; 100]` //~^ ERROR `atomic_load` intrinsic: expected basic integer type, found `[u8; 100]`
} }
unsafe fn test_Quux_store(p: &mut Quux, v: Quux) { pub unsafe fn test_Quux_store(p: &mut Quux, v: Quux) {
intrinsics::atomic_store(p, v); intrinsics::atomic_store(p, v);
//~^ ERROR `atomic_store` intrinsic: expected basic integer type, found `[u8; 100]` //~^ ERROR `atomic_store` intrinsic: expected basic integer type, found `[u8; 100]`
} }
unsafe fn test_Quux_xchg(p: &mut Quux, v: Quux) { pub unsafe fn test_Quux_xchg(p: &mut Quux, v: Quux) {
intrinsics::atomic_xchg(p, v); intrinsics::atomic_xchg(p, v);
//~^ ERROR `atomic_xchg` intrinsic: expected basic integer type, found `[u8; 100]` //~^ ERROR `atomic_xchg` intrinsic: expected basic integer type, found `[u8; 100]`
} }
unsafe fn test_Quux_cxchg(p: &mut Quux, v: Quux) { pub unsafe fn test_Quux_cxchg(p: &mut Quux, v: Quux) {
intrinsics::atomic_cxchg(p, v, v); intrinsics::atomic_cxchg(p, v, v);
//~^ ERROR `atomic_cxchg` intrinsic: expected basic integer type, found `[u8; 100]` //~^ ERROR `atomic_cxchg` intrinsic: expected basic integer type, found `[u8; 100]`
} }
fn main() {}