-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rewrite sepcomp-inlining and -separate to rmake.rs
- Loading branch information
Showing
7 changed files
with
56 additions
and
44 deletions.
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 was deleted.
Oops, something went wrong.
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,13 @@ | ||
// Check that cross-crate inlined items are inlined in all compilation units | ||
// that refer to them, and not in any other compilation units. | ||
// Note that we have to pass `-C codegen-units=6` because up to two CGUs may be | ||
// created for each source module (see `rustc_const_eval::monomorphize::partitioning`). | ||
// See https://github.com/rust-lang/rust/pull/16367 | ||
|
||
use run_make_support::{count_regex_matches_in_file_glob, rustc}; | ||
|
||
fn main() { | ||
rustc().input("cci_lib.rs").run(); | ||
rustc().input("foo.rs").emit("llvm-ir").codegen_units(6).arg("-Zinline-in-all-cgus").run(); | ||
assert_eq!(count_regex_matches_in_file_glob(r#"define\ .*cci_fn"#, "foo.*.ll"), 2); | ||
} |
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
// Test that #[inline] functions still get inlined across compilation unit | ||
// boundaries. Compilation should produce three IR files, but only the two | ||
// compilation units that have a usage of the #[inline] function should | ||
// contain a definition. Also, the non-#[inline] function should be defined | ||
// in only one compilation unit. | ||
// See https://github.com/rust-lang/rust/pull/16367 | ||
|
||
use run_make_support::{count_regex_matches_in_file_glob, glob, regex, rustc}; | ||
|
||
fn main() { | ||
rustc().input("foo.rs").emit("llvm-ir").codegen_units(3).arg("-Zinline-in-all-cgus").run(); | ||
assert_eq!(count_regex_matches_in_file_glob(r#"define\ i32\ .*inlined"#, "foo.*.ll"), 0); | ||
assert_eq!(count_regex_matches_in_file_glob(r#"define\ internal\ .*inlined"#, "foo.*.ll"), 2); | ||
assert_eq!(count_regex_matches_in_file_glob(r#"define\ hidden\ i32\ .*normal"#, "foo.*.ll"), 1); | ||
assert_eq!( | ||
count_regex_matches_in_file_glob(r#"declare\ hidden\ i32\ .*normal"#, "foo.*.ll"), | ||
2 | ||
); | ||
} |
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