Rollup merge of #63259 - JohnTitor:add-tests-for-some-issues, r=Centril

Add tests for some issues

Closes #29265
Closes #37433
Closes #49544

r? @Centril
This commit is contained in:
Mazdak Farrokhzad 2019-08-08 07:35:32 +02:00 committed by GitHub
commit 5277c71e84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,9 @@
#![crate_type = "lib"]
pub struct SomeType {
pub some_member: usize,
}
pub static SOME_VALUE: SomeType = SomeType {
some_member: 1,
};

View File

@ -0,0 +1,7 @@
#![crate_type = "lib"]
pub fn foo() -> Vec<String> {
std::env::args()
.skip(1)
.collect()
}

View File

@ -0,0 +1,10 @@
// aux-build:issue-29265.rs
// check-pass
extern crate issue_29265 as lib;
static _UNUSED: &'static lib::SomeType = &lib::SOME_VALUE;
fn main() {
vec![0u8; lib::SOME_VALUE.some_member];
}

View File

@ -0,0 +1,10 @@
// ignore-emscripten no asm! support
#![feature(asm)]
fn main() {
unsafe {
asm!("" :: "r"(""));
//~^ ERROR: invalid value for constraint in inline assembly
}
}

View File

@ -0,0 +1,8 @@
error[E0669]: invalid value for constraint in inline assembly
--> $DIR/issue-37433.rs:7:24
|
LL | asm!("" :: "r"(""));
| ^^
error: aborting due to previous error

View File

@ -0,0 +1,9 @@
// aux-build:issue-49544.rs
// check-pass
extern crate issue_49544;
use issue_49544::foo;
fn main() {
let _ = foo();
}