forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#120664 - SparrowLii:parallel_test, r=nnethercote Add parallel rustc ui tests Updates rust-lang#118698 Add some ui tests for parallel rustc front end This is a relatively large feature so I think it's worth creating a new entity in tests/ui folder, so we need to modify the limit in tidy.
- Loading branch information
Showing
7 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
tests/ui/parallel-rustc/cache-after-waiting-issue-111528.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// compile-flags: -Z threads=16 | ||
// build-fail | ||
|
||
#![crate_type="rlib"] | ||
#![allow(warnings)] | ||
|
||
#[export_name="fail"] | ||
pub fn a() { | ||
} | ||
|
||
#[export_name="fail"] | ||
pub fn b() { | ||
//~^ Error symbol `fail` is already defined | ||
} | ||
|
||
fn main() {} |
8 changes: 8 additions & 0 deletions
8
tests/ui/parallel-rustc/cache-after-waiting-issue-111528.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: symbol `fail` is already defined | ||
--> $DIR/cache-after-waiting-issue-111528.rs:12:1 | ||
| | ||
LL | pub fn b() { | ||
| ^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
7 changes: 7 additions & 0 deletions
7
tests/ui/parallel-rustc/export-symbols-deadlock-issue-118205-2.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// compile-flags:-C extra-filename=-1 -Z threads=16 | ||
// no-prefer-dynamic | ||
// build-pass | ||
#![crate_name = "crateresolve1"] | ||
#![crate_type = "lib"] | ||
|
||
pub fn f() -> isize { 10 } |
22 changes: 22 additions & 0 deletions
22
tests/ui/parallel-rustc/export-symbols-deadlock-issue-118205.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// compile-flags: -Z threads=16 | ||
// build-pass | ||
|
||
pub static GLOBAL: isize = 3; | ||
|
||
static GLOBAL0: isize = 4; | ||
|
||
pub static GLOBAL2: &'static isize = &GLOBAL0; | ||
|
||
pub fn verify_same(a: &'static isize) { | ||
let a = a as *const isize as usize; | ||
let b = &GLOBAL as *const isize as usize; | ||
assert_eq!(a, b); | ||
} | ||
|
||
pub fn verify_same2(a: &'static isize) { | ||
let a = a as *const isize as usize; | ||
let b = GLOBAL2 as *const isize as usize; | ||
assert_eq!(a, b); | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// compile-flags: -Z threads=8 | ||
// run-pass | ||
|
||
fn main() { | ||
println!("Hello world!"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// compile-flags: -Z threads=16 | ||
// run-pass | ||
|
||
#[repr(transparent)] | ||
struct Sched { | ||
i: i32, | ||
} | ||
impl Sched { | ||
extern "C" fn get(self) -> i32 { self.i } | ||
} | ||
|
||
fn main() { | ||
let s = Sched { i: 4 }; | ||
let f = || -> i32 { | ||
s.get() | ||
}; | ||
println!("f: {}", f()); | ||
} |