compiletest: Remove skip-codegen

This commit is contained in:
Vadim Petrochenkov 2019-06-12 18:18:32 +03:00
parent 8e8fba1b3b
commit 932ea64175
56 changed files with 316 additions and 402 deletions

View File

@ -1,6 +1,6 @@
// revisions:cfail1 cfail2
// check-pass
// compile-flags: --crate-type cdylib
// skip-codegen
#![deny(unused_attributes)]

View File

@ -1,3 +1,4 @@
// check-pass
// ignore-android
// ignore-arm
// ignore-aarch64
@ -11,14 +12,11 @@
// ignore-mips
// ignore-mips64
// compile-pass
// skip-codegen
#![feature(asm)]
#![allow(dead_code, non_upper_case_globals)]
#[cfg(any(target_arch = "x86",
target_arch = "x86_64"))]
pub fn main() {
fn main() {
// assignment not dead
let mut x: isize = 0;
unsafe {

View File

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

View File

@ -1,10 +1,10 @@
// compile-pass
// skip-codegen
#![allow(warnings)]
// check-pass
pub type ParseResult<T> = Result<T, ()>;
pub enum Item<'a> { Literal(&'a str),
}
pub enum Item<'a> {
Literal(&'a str)
}
pub fn colon_or_space(s: &str) -> ParseResult<&str> {
unimplemented!()
@ -20,10 +20,9 @@ pub fn parse<'a, I>(mut s: &str, items: I) -> ParseResult<()>
macro_rules! try_consume {
($e:expr) => ({ let (s_, v) = try!($e); s = s_; v })
}
let offset = try_consume!(timezone_offset_zulu(s.trim_left(), colon_or_space));
let offset = try_consume!(timezone_offset_zulu(s.trim_left(), colon_or_space));
let offset = try_consume!(timezone_offset_zulu(s.trim_start(), colon_or_space));
let offset = try_consume!(timezone_offset_zulu(s.trim_start(), colon_or_space));
Ok(())
}
fn main() { }
fn main() {}

View File

@ -1,10 +1,9 @@
// compile-pass
// skip-codegen
#![allow(warnings)]
// Check that you are allowed to implement using elision but write
// trait without elision (a bug in this cropped up during
// bootstrapping, so this is a regression test).
// check-pass
pub struct SplitWhitespace<'a> {
x: &'a u8
}

View File

@ -1,10 +1,9 @@
// check-pass
// compile-flags: --cap-lints warn
#![warn(unused)]
#![deny(warnings)]
// compile-pass
// skip-codegen
use std::option; //~ WARN
fn main() {}

View File

@ -5,7 +5,7 @@ LL | use std::option;
| ^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/bad-lint-cap3.rs:4:9
--> $DIR/bad-lint-cap3.rs:5:9
|
LL | #![deny(warnings)]
| ^^^^^^^^

View File

@ -1,11 +1,10 @@
// compile-pass
// skip-codegen
// Here we do not get a coherence conflict because `Baz: Iterator`
// does not hold and (due to the orphan rules), we can rely on that.
// check-pass
// revisions: old re
#![cfg_attr(re, feature(re_rebalance_coherence))]
#![allow(dead_code)]
// Here we do not get a coherence conflict because `Baz: Iterator`
// does not hold and (due to the orphan rules), we can rely on that.
pub trait Foo<P> {}
@ -18,5 +17,4 @@ impl Foo<i32> for Baz { }
impl<A:Iterator> Foo<A::Item> for A { }
fn main() {}

View File

@ -1,8 +1,8 @@
// compile-pass
// skip-codegen
// check-pass
// revisions: old re
#![cfg_attr(re, feature(re_rebalance_coherence))]
pub trait Foo<P> {}
pub trait Bar {
@ -17,5 +17,4 @@ impl Bar for i32 {
type Output = u32;
}
fn main() {}

View File

@ -1,13 +1,11 @@
// Test that we are able to introduce a negative constraint that
// `MyType: !MyTrait` along with other "fundamental" wrappers.
// check-pass
// aux-build:coherence_copy_like_lib.rs
// compile-pass
// skip-codegen
// revisions: old re
#![cfg_attr(re, feature(re_rebalance_coherence))]
#![allow(dead_code)]
extern crate coherence_copy_like_lib as lib;
@ -23,5 +21,4 @@ impl<T: lib::MyCopy> MyTrait for T { }
// Huzzah.
impl<'a> MyTrait for lib::MyFundamentalStruct<&'a MyType> { }
fn main() { }

View File

@ -1,13 +1,11 @@
// Test that we are able to introduce a negative constraint that
// `MyType: !MyTrait` along with other "fundamental" wrappers.
// check-pass
// aux-build:coherence_copy_like_lib.rs
// compile-pass
// skip-codegen
// revisions: old re
#![cfg_attr(re, feature(re_rebalance_coherence))]
#![allow(dead_code)]
extern crate coherence_copy_like_lib as lib;
@ -22,5 +20,4 @@ impl lib::MyCopy for Box<MyType> { }
impl lib::MyCopy for lib::MyFundamentalStruct<MyType> { }
impl lib::MyCopy for lib::MyFundamentalStruct<Box<MyType>> { }
fn main() { }
fn main() {}

View File

@ -1,13 +1,11 @@
// Test that we are able to introduce a negative constraint that
// `MyType: !MyTrait` along with other "fundamental" wrappers.
// check-pass
// aux-build:coherence_copy_like_lib.rs
// compile-pass
// skip-codegen
// revisions: old re
#![cfg_attr(re, feature(re_rebalance_coherence))]
#![allow(dead_code)]
extern crate coherence_copy_like_lib as lib;
@ -16,5 +14,4 @@ struct MyType { x: i32 }
// naturally, legal
impl lib::MyCopy for MyType { }
fn main() { }

View File

@ -1,13 +1,12 @@
// compile-pass
// skip-codegen
#![allow(dead_code)]
// check-pass
#![deny(unused_attributes)] // c.f #35584
mod auxiliary {
#[cfg_attr(any(), path = "nonexistent_file.rs")] pub mod namespaced_enums;
#[cfg_attr(all(), path = "namespaced_enums.rs")] pub mod nonexistent_file;
}
fn main() {
let _ = auxiliary::namespaced_enums::Foo::A;
let _ = auxiliary::nonexistent_file::Foo::A;

View File

@ -1,15 +1,12 @@
// Test use of const fn from another crate without a feature gate.
// compile-pass
// skip-codegen
#![allow(unused_variables)]
// check-pass
// aux-build:const_fn_lib.rs
extern crate const_fn_lib;
use const_fn_lib::foo;
fn main() {
let x = foo(); // use outside a constant is ok
}

View File

@ -30,8 +30,9 @@
// inputs are handled by each, and (2.) to ease searching for related
// occurrences in the source text.
// check-pass
#![warn(unused_attributes, unknown_lints)]
#![allow(stable_features)]
// UNGATED WHITE-LISTED BUILT-IN ATTRIBUTES
@ -75,7 +76,7 @@
// see issue-43106-gating-of-stable.rs
// see issue-43106-gating-of-unstable.rs
// see issue-43106-gating-of-deprecated.rs
#![windows_subsystem = "1000"]
#![windows_subsystem = "windows"]
// UNGATED CRATE-LEVEL BUILT-IN ATTRIBUTES
@ -539,7 +540,7 @@ mod export_name {
#[export_name = "2200"] impl S { }
}
// Note that this test has a `skip-codegen`, so it
// Note that this is a `check-pass` test, so it
// will never invoke the linker. These are here nonetheless to point
// out that we allow them at non-crate-level (though I do not know
// whether they have the same effect here as at crate-level).
@ -611,17 +612,17 @@ mod must_use {
#[must_use] impl S { }
}
#[windows_subsystem = "1000"]
#[windows_subsystem = "windows"]
mod windows_subsystem {
mod inner { #![windows_subsystem="1000"] }
mod inner { #![windows_subsystem="windows"] }
#[windows_subsystem = "1000"] fn f() { }
#[windows_subsystem = "windows"] fn f() { }
#[windows_subsystem = "1000"] struct S;
#[windows_subsystem = "windows"] struct S;
#[windows_subsystem = "1000"] type T = S;
#[windows_subsystem = "windows"] type T = S;
#[windows_subsystem = "1000"] impl S { }
#[windows_subsystem = "windows"] impl S { }
}
// BROKEN USES OF CRATE-LEVEL BUILT-IN ATTRIBUTES

View File

@ -5,8 +5,7 @@
//
// (For non-crate-level cases, see issue-43106-gating-of-builtin-attrs.rs)
// compile-pass
// skip-codegen
// check-pass
#![deprecated]

View File

@ -1,5 +1,5 @@
// compile-pass
// skip-codegen
// check-pass
mod foo {
pub use bar::*;
pub use main as f;
@ -15,5 +15,4 @@ mod baz {
pub use super::*;
}
pub fn main() {}

View File

@ -1,8 +1,8 @@
// check-pass
// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro, associated_type_defaults)]
// compile-pass
// skip-codegen
trait Base {
type AssocTy;
fn f();
@ -35,5 +35,4 @@ macro mac() {
mac!();
fn main() {}

View File

@ -1,10 +1,8 @@
// compile-pass
// skip-codegen
#![allow(warnings)]
// check-pass
// This used to ICE because the "if" being unreachable was not handled correctly
fn err() {
if loop {} {}
}
fn main() {}

View File

@ -1,10 +1,8 @@
// check-pass
// aux-build:import_crate_var.rs
// compile-pass
// skip-codegen
#[macro_use] extern crate import_crate_var;
fn main() {
m!();
//~^ WARN `$crate` may not be imported

View File

@ -1,5 +1,5 @@
warning: `$crate` may not be imported
--> $DIR/import-crate-var.rs:9:5
--> $DIR/import-crate-var.rs:7:5
|
LL | m!();
| ^^^^^

View File

@ -1,6 +1,5 @@
// compile-pass
// skip-codegen
#![allow(warnings)]
// check-pass
struct Attr {
name: String,
value: String,
@ -21,7 +20,6 @@ impl Element {
}
}
fn main() {
let element = Element { attrs: Vec::new() };
let _ = unsafe { element.get_attr("foo") };

View File

@ -1,10 +1,9 @@
// compile-pass
// skip-codegen
// check-pass
fn cb<'a,T>(_x: Box<dyn Fn((&'a i32, &'a (Vec<&'static i32>, bool))) -> T>) -> T {
panic!()
}
fn main() {
cb(Box::new(|(k, &(ref v, b))| (*k, v.clone(), b)));
}

View File

@ -1,9 +1,6 @@
// compile-pass
// skip-codegen
#![allow(warnings)]
// check-pass
trait A<T> {}
struct B<T> where B<T>: A<B<T>> { t: T }
fn main() {
}
fn main() {}

View File

@ -1,6 +1,7 @@
// check-pass
#![feature(unboxed_closures, fn_traits)]
struct Foo;
impl<A> FnOnce<(A,)> for Foo {

View File

@ -1,6 +1,7 @@
// compile-pass
// skip-codegen
// check-pass
#![feature(unboxed_closures, fn_traits)]
fn main() {
let k = |x: i32| { x + 1 };
Fn::call(&k, (0,));

View File

@ -1,6 +1,5 @@
// compile-pass
// skip-codegen
#![allow(warnings)]
// check-pass
struct CNFParser {
token: char,
}
@ -14,12 +13,11 @@ impl CNFParser {
self.consume_while(&(CNFParser::is_whitespace))
}
fn consume_while(&mut self, p: &Fn(char) -> bool) {
fn consume_while(&mut self, p: &dyn Fn(char) -> bool) {
while p(self.token) {
return
}
}
}
fn main() {}

View File

@ -1,5 +1,5 @@
// compile-pass
// skip-codegen
// check-pass
mod a {
pub mod b { pub struct Foo; }
@ -11,7 +11,6 @@ mod a {
pub use self::c::*;
}
fn main() {
let _ = a::c::Bar(a::b::Foo);
let _ = a::Bar(a::b::Foo);

View File

@ -1,6 +1,5 @@
// compile-pass
// skip-codegen
#![allow(warnings)]
// check-pass
trait Mirror {
type It;
}
@ -9,8 +8,6 @@ impl<T> Mirror for T {
type It = Self;
}
fn main() {
let c: <u32 as Mirror>::It = 5;
const CCCC: <u32 as Mirror>::It = 5;

View File

@ -1,10 +1,8 @@
// compile-pass
// skip-codegen
#![allow(unused)]
// check-pass
extern crate core;
use core as core_export;
use self::x::*;
mod x {}
fn main() {}

View File

@ -1,5 +1,4 @@
// compile-pass
// skip-codegen
// check-pass
use std::marker::PhantomData;
@ -17,5 +16,4 @@ pub trait Bar {
impl<T: 'static, W: Bar<Output = T>> Foo<*mut T> for W {}
fn main() {}

View File

@ -1,8 +1,8 @@
// compile-pass
// skip-codegen
#![deny(non_snake_case)]
#[no_mangle]
pub extern "C" fn SparklingGenerationForeignFunctionInterface() {}
// check-pass
#![deny(non_snake_case)]
#[no_mangle]
pub extern "C" fn SparklingGenerationForeignFunctionInterface() {} // OK
fn main() {}

View File

@ -1,6 +1,5 @@
// compile-pass
// skip-codegen
#![allow(dead_code)]
// check-pass
pub type T = ();
mod foo { pub use super::T; }
mod bar { pub use super::T; }
@ -15,5 +14,4 @@ mod baz {
pub use self::bar::*;
}
fn main() {}

View File

@ -1,6 +1,4 @@
// compile-pass
// skip-codegen
#![allow(warnings)]
// check-pass
mod foo {
pub fn bar() {}
@ -21,5 +19,4 @@ mod b {
pub use a::bar;
}
fn main() {}

View File

@ -1,5 +1,4 @@
// compile-pass
// skip-codegen
// check-pass
pub use bar::*;
mod bar {
@ -11,5 +10,4 @@ mod baz {
pub use main as f;
}
pub fn main() {}

View File

@ -1,6 +1,4 @@
// compile-pass
// skip-codegen
#![allow(warnings)]
// check-pass
macro_rules! foo { () => {
let x = 1;
@ -22,7 +20,6 @@ macro_rules! baz {
}
}
fn main() {
foo! {};
bar! {};

View File

@ -1,5 +1,4 @@
// compile-pass
// skip-codegen
// check-pass
use std::fmt;
@ -7,7 +6,6 @@ use std::fmt;
// an unsized tuple by transmuting a trait object.
fn any<T>() -> T { unreachable!() }
fn main() {
let t: &(u8, dyn fmt::Debug) = any();
println!("{:?}", &t.1);

View File

@ -1,5 +1,4 @@
// compile-pass
// skip-codegen
// check-pass
macro_rules! m {
() => { #[cfg(any())] fn f() {} }
@ -8,5 +7,4 @@ macro_rules! m {
trait T {}
impl T for () { m!(); }
fn main() {}

View File

@ -1,12 +1,10 @@
// compile-pass
// skip-codegen
// check-pass
macro_rules! null { ($i:tt) => {} }
macro_rules! apply_null {
($i:item) => { null! { $i } }
}
fn main() {
apply_null!(#[cfg(all())] fn f() {});
}

View File

@ -1,6 +1,4 @@
// compile-pass
// skip-codegen
#![allow(unused)]
// check-pass
macro_rules! make_item {
() => { fn f() {} }
@ -18,5 +16,4 @@ fn g() {
make_stmt! {}
}
fn main() {}

View File

@ -1,6 +1,4 @@
// compile-pass
// skip-codegen
#![allow(dead_code)]
// check-pass
trait RegularExpression: Sized {
type Text;
@ -18,5 +16,4 @@ enum FindCapturesInner<'r, 't> {
Dynamic(FindCaptures<'t, ExecNoSyncStr<'r>>),
}
fn main() {}

View File

@ -1,5 +1,4 @@
// compile-pass
// skip-codegen
// check-pass
use std::mem;
@ -25,7 +24,6 @@ fn foo<'a>(x: &'a ()) -> <() as Lifetime<'a>>::Out {
fn takes_lifetime(_f: for<'a> fn(&'a ()) -> <() as Lifetime<'a>>::Out) {
}
fn main() {
takes_lifetime(foo);
}

View File

@ -1,8 +1,7 @@
// Unnecessary path disambiguator is ok
// compile-pass
// skip-codegen
#![allow(unused)]
// check-pass
macro_rules! m {
($p: path) => {
let _ = $p(0);
@ -23,5 +22,4 @@ fn f() {
m!(S::<u8>);
}
fn main() {}

View File

@ -1,7 +1,5 @@
// compile-pass
// skip-codegen
// check-pass
fn _test() -> impl Default { }
fn main() { }
fn main() {}

View File

@ -1,5 +1,4 @@
// compile-pass
// skip-codegen
// check-pass
pub trait Foo {
type Bar;
@ -17,7 +16,6 @@ impl<T> Broken for T {
}
}
fn main() {
let _m: &dyn Broken<Assoc=()> = &();
}

View File

@ -1,7 +1,7 @@
// compile-pass
// skip-codegen
// check-pass
#![feature(associated_type_defaults)]
#![allow(warnings)]
trait State: Sized {
type NextState: State = StateMachineEnded;
fn execute(self) -> Option<Self::NextState>;
@ -15,6 +15,4 @@ impl State for StateMachineEnded {
}
}
fn main() {
}
fn main() {}

View File

@ -1,6 +1,6 @@
// check-pass
// ignore-emscripten
// compile-pass
// skip-codegen
#![feature(asm)]
macro_rules! interrupt_handler {
@ -12,6 +12,4 @@ macro_rules! interrupt_handler {
}
interrupt_handler!{}
fn main() {
}
fn main() {}

View File

@ -1,9 +1,7 @@
// compile-pass
// skip-codegen
// check-pass
fn foo(_: &mut i32) -> bool { true }
fn main() {
let opt = Some(92);
let mut x = 62;

View File

@ -1,7 +1,5 @@
// compile-pass
// skip-codegen
#![feature(associated_consts)]
#![allow(warnings)]
// check-pass
trait MyTrait {
const MY_CONST: &'static str;
}
@ -18,5 +16,4 @@ macro_rules! my_macro {
my_macro!();
fn main() {}

View File

@ -1,9 +1,7 @@
// compile-pass
// skip-codegen
// check-pass
use std::ops::Deref;
fn main() {
let _x: fn(&i32) -> <&i32 as Deref>::Target = unimplemented!();
}

View File

@ -1,6 +1,4 @@
// compile-pass
// skip-codegen
#![allow(warnings)]
// check-pass
enum E {
A = {
@ -9,5 +7,4 @@ enum E {
}
}
fn main() {}

View File

@ -1,12 +1,11 @@
// Basic test for free regions in the NLL code. This test does not
// report an error because of the (implied) bound that `'b: 'a`.
// check-pass
// compile-flags:-Zborrowck=mir -Zverbose
// compile-pass
// skip-codegen
fn foo<'a, 'b>(x: &'a &'b u32) -> &'a u32 {
&**x
}
fn main() { }
fn main() {}

View File

@ -1,5 +1,5 @@
// compile-pass
// skip-codegen
// check-pass
#![deny(unreachable_patterns)]
#![feature(exhaustive_patterns)]
#![feature(never_type)]

View File

@ -1,5 +1,5 @@
// compile-pass
// skip-codegen
// check-pass
#![deny(unreachable_patterns)]
#![feature(exhaustive_patterns)]
#![feature(never_type)]

View File

@ -539,13 +539,10 @@ impl TestProps {
let pass_mode = if config.parse_name_directive(ln, "check-pass") {
check_no_run("check-pass");
Some(PassMode::Check)
} else if config.parse_name_directive(ln, "skip-codegen") {
check_no_run("skip-codegen");
Some(PassMode::Check)
} else if config.parse_name_directive(ln, "build-pass") {
check_no_run("build-pass");
Some(PassMode::Build)
} else if config.parse_name_directive(ln, "compile-pass") {
} else if config.parse_name_directive(ln, "compile-pass") /* compatibility */ {
check_no_run("compile-pass");
Some(PassMode::Build)
} else if config.parse_name_directive(ln, "run-pass") {
@ -558,7 +555,6 @@ impl TestProps {
};
match (self.pass_mode, pass_mode) {
(None, Some(_)) => self.pass_mode = pass_mode,
(Some(_), Some(pm)) if pm == PassMode::Check => self.pass_mode = pass_mode,
(Some(_), Some(_)) => panic!("multiple `*-pass` headers in a single test"),
(_, None) => {}
}