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
pub fn something() {}
fn main() {}
fn main() {
something();
}

View File

@ -10,6 +10,7 @@
#![feature(repr_simd, platform_intrinsics, core_intrinsics)]
#![allow(warnings)]
#![crate_type = "rlib"]
// Bad monomorphizations could previously cause LLVM asserts even though the
// error was caught in the compiler.
@ -21,21 +22,19 @@ extern "platform-intrinsic" {
use std::intrinsics;
#[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)
//~^ 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)
//~^ 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)
//~^ ERROR `simd_add` intrinsic: expected SIMD input type, found non-SIMD `Foo`
}
fn main() {}

View File

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

View File

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

View File

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

View File

@ -10,92 +10,91 @@
#![feature(core_intrinsics)]
#![allow(warnings)]
#![crate_type = "rlib"]
use std::intrinsics;
#[derive(Copy, Clone)]
struct Foo(i64);
type Bar = &'static Fn();
type Quux = [u8; 100];
pub struct Foo(i64);
pub type Bar = &'static Fn();
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);
//~^ 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);
//~^ 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);
//~^ 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);
//~^ 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);
//~^ 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);
//~^ 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);
//~^ 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);
//~^ 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);
//~^ 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);
//~^ 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);
//~^ 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);
//~^ 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);
//~^ 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);
//~^ 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);
//~^ 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);
//~^ ERROR `atomic_cxchg` intrinsic: expected basic integer type, found `[u8; 100]`
}
fn main() {}