forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show files produced by --emit foo in json artifact notifications
- Loading branch information
Showing
6 changed files
with
110 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
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
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
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
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,23 @@ | ||
//@ compile-flags: -C codegen-units=1 --emit asm,llvm-ir,llvm-bc,obj --json=artifacts --error-format=json | ||
|
||
fn one() -> usize { | ||
1 | ||
} | ||
|
||
pub mod a { | ||
pub fn two() -> usize { | ||
::one() + ::one() | ||
} | ||
} | ||
|
||
pub mod b { | ||
pub fn three() -> usize { | ||
::one() + ::a::two() | ||
} | ||
} | ||
|
||
#[inline(never)] | ||
pub fn main() { | ||
a::two(); | ||
b::three(); | ||
} |
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,37 @@ | ||
extern crate run_make_support; | ||
|
||
use run_make_support::{rustc, tmp_dir}; | ||
|
||
fn main() { | ||
let inc_dir = tmp_dir(); | ||
|
||
for _ in 0..=1 { | ||
let output = rustc() | ||
.input("lib.rs") | ||
.arg("--emit=obj,asm,llvm-ir,llvm-bc,mir") | ||
.arg("-Ccodegen-units=1") | ||
.arg("--json=artifacts") | ||
.arg("--error-format=json") | ||
.arg(format!("-Cincremental={}", inc_dir.to_str().expect("temp dir?")).as_str()) | ||
.run(); | ||
let stderr = String::from_utf8_lossy(&output.stderr); | ||
for file in &["lib.o", "lib.ll", "lib.bc", "lib.s"] { | ||
assert!(stderr.contains(file), "No {:?} in {:?}", file, stderr); | ||
} | ||
} | ||
|
||
for _ in 0..=1 { | ||
let output = rustc() | ||
.input("lib.rs") | ||
.arg("--emit=obj,asm,llvm-ir,llvm-bc,mir") | ||
.arg("-Ccodegen-units=2") | ||
.arg("--json=artifacts") | ||
.arg("--error-format=json") | ||
.arg(format!("-Cincremental={}", inc_dir.to_str().expect("temp dir?")).as_str()) | ||
.run(); | ||
let stderr = String::from_utf8_lossy(&output.stderr); | ||
for file in &["rcgu.o", "rcgu.ll", "rcgu.bc", "rcgu.s"] { | ||
assert!(stderr.contains(file), "No {:?} in {:?}", file, stderr); | ||
} | ||
} | ||
} |