12 files changed +74
-50
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ pub use llvm::{
35
35
LlvmProfdata , LlvmReadobj ,
36
36
} ;
37
37
pub use run:: { cmd, run, run_fail, run_with_args} ;
38
- pub use rustc:: { aux_build, rustc, Rustc } ;
38
+ pub use rustc:: { aux_build, bare_rustc , rustc, Rustc } ;
39
39
pub use rustdoc:: { bare_rustdoc, rustdoc, Rustdoc } ;
40
40
41
41
#[ track_caller]
Original file line number Diff line number Diff line change @@ -10,6 +10,12 @@ pub fn rustc() -> Rustc {
10
10
Rustc :: new ( )
11
11
}
12
12
13
+ /// Construct a plain `rustc` invocation with no flags set.
14
+ #[ track_caller]
15
+ pub fn bare_rustc ( ) -> Rustc {
16
+ Rustc :: bare ( )
17
+ }
18
+
13
19
/// Construct a new `rustc` aux-build invocation.
14
20
#[ track_caller]
15
21
pub fn aux_build ( ) -> Rustc {
@@ -30,7 +36,6 @@ fn setup_common() -> Command {
30
36
let rustc = env_var ( "RUSTC" ) ;
31
37
let mut cmd = Command :: new ( rustc) ;
32
38
set_host_rpath ( & mut cmd) ;
33
- cmd. arg ( "-L" ) . arg ( cwd ( ) ) ;
34
39
cmd
35
40
}
36
41
@@ -40,6 +45,14 @@ impl Rustc {
40
45
/// Construct a new `rustc` invocation.
41
46
#[ track_caller]
42
47
pub fn new ( ) -> Self {
48
+ let mut cmd = setup_common ( ) ;
49
+ cmd. arg ( "-L" ) . arg ( cwd ( ) ) ;
50
+ Self { cmd }
51
+ }
52
+
53
+ /// Construct a bare `rustc` invocation with no flags set.
54
+ #[ track_caller]
55
+ pub fn bare ( ) -> Self {
43
56
let cmd = setup_common ( ) ;
44
57
Self { cmd }
45
58
}
Original file line number Diff line number Diff line change @@ -62,7 +62,6 @@ run-make/issue-28595/Makefile
62
62
run-make/issue-33329/Makefile
63
63
run-make/issue-35164/Makefile
64
64
run-make/issue-36710/Makefile
65
- run-make/issue-37839/Makefile
66
65
run-make/issue-47551/Makefile
67
66
run-make/issue-69368/Makefile
68
67
run-make/issue-83045/Makefile
@@ -156,8 +155,6 @@ run-make/target-without-atomic-cas/Makefile
156
155
run-make/test-benches/Makefile
157
156
run-make/thumb-none-cortex-m/Makefile
158
157
run-make/thumb-none-qemu/Makefile
159
- run-make/track-path-dep-info/Makefile
160
- run-make/track-pgo-dep-info/Makefile
161
158
run-make/translation/Makefile
162
159
run-make/type-mismatch-same-crate-name/Makefile
163
160
run-make/unstable-flag-required/Makefile
Load Diff This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ // A compiler bug caused the following issue:
2
+ // If a crate A depends on crate B, and crate B
3
+ // depends on crate C, and crate C contains a procedural
4
+ // macro, compiling crate A would fail.
5
+ // This was fixed in #37846, and this test checks
6
+ // that this bug does not make a resurgence.
7
+
8
+ //FIXME(Oneirical): ignore-cross-compile
9
+
10
+ use run_make_support:: { bare_rustc, cwd, rust_lib_name, rustc} ;
11
+
12
+ fn main ( ) {
13
+ rustc ( ) . input ( "a.rs" ) . run ( ) ;
14
+ rustc ( ) . input ( "b.rs" ) . run ( ) ;
15
+ let curr_dir = cwd ( ) . display ( ) . to_string ( ) ;
16
+ bare_rustc ( )
17
+ . input ( "c.rs" )
18
+ . arg ( format ! ( "-Ldependency={curr_dir}" ) )
19
+ . extern_ ( "b" , cwd ( ) . join ( rust_lib_name ( "b" ) ) )
20
+ . out_dir ( cwd ( ) )
21
+ . run ( ) ;
22
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ // This test checks the functionality of `tracked_path::path`, a procedural macro
2
+ // feature that adds a dependency to another file inside the procmacro. In this case,
3
+ // the text file is added through this method, and the test checks that the compilation
4
+ // output successfully added the file as a dependency.
5
+ // See https://github.com/rust-lang/rust/pull/84029
6
+
7
+ //FIXME(Oneirical): Try it on musl
8
+
9
+ use run_make_support:: { fs_wrapper, rustc} ;
10
+
11
+ fn main ( ) {
12
+ rustc ( ) . input ( "macro_def.rs" ) . run ( ) ;
13
+ rustc ( ) . env ( "EXISTING_PROC_MACRO_ENV" , "1" ) . emit ( "dep-info" ) . input ( "macro_use.rs" ) . run ( ) ;
14
+ assert ! ( fs_wrapper:: read_to_string( "macro_use.d" ) . contains( "emojis.txt:" ) ) ;
15
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ // Emitting dep-info files used to not have any mention of PGO profiles used
2
+ // in compilation, which meant these profiles could be changed without consequence.
3
+ // After changing this in #100801, this test checks that the profile data is successfully
4
+ // included in dep-info emit files.
5
+ // See https://github.com/rust-lang/rust/pull/100801
6
+
7
+ //FIXME(Oneirical): try it on musl
8
+ //@ needs-profiler-support
9
+
10
+ use run_make_support:: { fs_wrapper, llvm_profdata, run, rustc} ;
11
+
12
+ fn main ( ) {
13
+ // Generate the profile-guided-optimization (PGO) profiles
14
+ rustc ( ) . profile_generate ( "profiles" ) . input ( "main.rs" ) . run ( ) ;
15
+ // Merge the profiles
16
+ run ( "main" ) ;
17
+ llvm_profdata ( ) . merge ( ) . output ( "merged.profdata" ) . input ( "profiles" ) . run ( ) ;
18
+ // Use the profiles in compilation
19
+ rustc ( ) . profile_use ( "merged.profdata" ) . emit ( "dep-info" ) . input ( "main.rs" ) . run ( ) ;
20
+ // Check that the profile file is in the dep-info emit file
21
+ assert ! ( fs_wrapper:: read_to_string( "main.d" ) . contains( "merged.profdata" ) ) ;
22
+ }
0 commit comments