1
Fork 0

Fixing broken tests #62401

The grouping led to a lot of `mv`. Therefore, some relative paths were
wrong. In this commit the dependent files were also moved so that the paths
work again.
This commit is contained in:
Kevin Per 2019-07-11 19:40:09 +02:00
parent 98325eb592
commit cac53fe3f2
9 changed files with 136 additions and 0 deletions

View file

@ -0,0 +1,14 @@
// run-pass
// aux-build:anon-extern-mod-cross-crate-1.rs
// pretty-expanded FIXME #23616
// ignore-wasm32-bare no libc to test ffi with
extern crate anonexternmod;
use anonexternmod::rust_get_test_int;
pub fn main() {
unsafe {
rust_get_test_int();
}
}

View file

@ -0,0 +1,8 @@
// aux-build:anon-extern-mod-cross-crate-1.rs
// aux-build:anon-extern-mod-cross-crate-1.rs
// pretty-expanded FIXME #23616
// ignore-wasm32-bare no libc to test ffi with
extern crate anonexternmod;
pub fn main() { }

View file

@ -0,0 +1,21 @@
// run-pass
// aux-build:extern-crosscrate-source.rs
// ignore-wasm32-bare no libc to test ffi with
#![feature(rustc_private)]
extern crate externcallback;
extern crate libc;
fn fact(n: libc::uintptr_t) -> libc::uintptr_t {
unsafe {
println!("n = {}", n);
externcallback::rustrt::rust_dbg_call(externcallback::cb, n)
}
}
pub fn main() {
let result = fact(10);
println!("result = {}", result);
assert_eq!(result, 3628800);
}

View file

@ -0,0 +1,17 @@
// run-pass
// aux-build:foreign_lib.rs
// ignore-wasm32-bare no libc to test ffi with
// Check that we can still call duplicated extern (imported) functions
// which were declared in another crate. See issues #32740 and #32783.
extern crate foreign_lib;
pub fn main() {
unsafe {
let x = foreign_lib::rustrt::rust_get_test_int();
assert_eq!(x, foreign_lib::rustrt2::rust_get_test_int());
assert_eq!(x as *const _, foreign_lib::rustrt3::rust_get_test_int());
}
}

View file

@ -0,0 +1,16 @@
// aux-build:foreign_lib.rs
// ignore-wasm32-bare no libc to test ffi with
// The purpose of this test is to check that we can
// successfully (and safely) invoke external, cdecl
// functions from outside the crate.
// pretty-expanded FIXME #23616
extern crate foreign_lib;
pub fn main() {
unsafe {
let _foo = foreign_lib::rustrt::rust_get_test_int();
}
}

View file

@ -0,0 +1,3 @@
extern crate issue_25185_1;
pub use issue_25185_1::rust_dbg_extern_identity_u32;

View file

@ -0,0 +1,13 @@
// run-pass
// aux-build:issue-25185-1.rs
// aux-build:issue-25185-2.rs
// ignore-wasm32-bare no libc for ffi testing
extern crate issue_25185_2;
fn main() {
let x = unsafe {
issue_25185_2::rust_dbg_extern_identity_u32(1)
};
assert_eq!(x, 1);
}

View file

@ -0,0 +1,26 @@
// force-host
// no-prefer-dynamic
#![crate_type = "proc-macro"]
extern crate proc_macro;
use proc_macro::TokenStream;
#[proc_macro_attribute]
pub fn nop_attr(_attr: TokenStream, input: TokenStream) -> TokenStream {
assert!(_attr.to_string().is_empty());
input
}
#[proc_macro_attribute]
pub fn no_output(_attr: TokenStream, _input: TokenStream) -> TokenStream {
assert!(_attr.to_string().is_empty());
assert!(!_input.to_string().is_empty());
"".parse().unwrap()
}
#[proc_macro]
pub fn emit_input(input: TokenStream) -> TokenStream {
input
}

View file

@ -0,0 +1,18 @@
// ignore-arm
// ignore-aarch64
// ignore-mips
// ignore-mips64
// ignore-powerpc
// ignore-s390x
// ignore-sparc
// ignore-sparc64
// ignore-wasm
// ignore-cloudabi no processes
// ignore-emscripten no processes
// ignore-sgx no processes
// ignore-musl FIXME #31506
// ignore-pretty
// compile-flags: -C lto
// no-prefer-dynamic
include!("stack-probes.rs");