File tree 4 files changed +27
-12
lines changed
tests/run-make/metadata-flag-frobs-symbols
4 files changed +27
-12
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,12 @@ impl Rustc {
73
73
self
74
74
}
75
75
76
+ /// Incorporate a hashed string to mangled symbols.
77
+ pub fn metadata ( & mut self , meta : & str ) -> & mut Self {
78
+ self . cmd . arg ( format ! ( "-Cmetadata={meta}" ) ) ;
79
+ self
80
+ }
81
+
76
82
/// Add a suffix in each output filename.
77
83
pub fn extra_filename ( & mut self , suffix : & str ) -> & mut Self {
78
84
self . cmd . arg ( format ! ( "-Cextra-filename={suffix}" ) ) ;
Original file line number Diff line number Diff line change @@ -119,7 +119,6 @@ run-make/macos-fat-archive/Makefile
119
119
run-make/manual-link/Makefile
120
120
run-make/many-crates-but-no-match/Makefile
121
121
run-make/metadata-dep-info/Makefile
122
- run-make/metadata-flag-frobs-symbols/Makefile
123
122
run-make/min-global-align/Makefile
124
123
run-make/mingw-export-call-convention/Makefile
125
124
run-make/mismatching-target-triples/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ // In this test, foo.rs is compiled twice with different hashes tied to its
2
+ // symbols thanks to the metadata flag. bar.rs then ensures that the memory locations
3
+ // of foo's symbols are different even though they came from the same original source code.
4
+ // This checks that the metadata flag is doing its job.
5
+ // See https://github.com/rust-lang/rust/issues/14471
6
+
7
+ //@ ignore-cross-compile
8
+
9
+ use run_make_support:: { run, rust_lib_name, rustc} ;
10
+
11
+ fn main ( ) {
12
+ rustc ( ) . input ( "foo.rs" ) . metadata ( "a" ) . extra_filename ( "-a" ) . run ( ) ;
13
+ rustc ( ) . input ( "foo.rs" ) . metadata ( "b" ) . extra_filename ( "-b" ) . run ( ) ;
14
+ rustc ( )
15
+ . input ( "bar.rs" )
16
+ . extern_ ( "foo1" , rust_lib_name ( "foo-a" ) )
17
+ . extern_ ( "foo2" , rust_lib_name ( "foo-b" ) )
18
+ . print ( "link-args" )
19
+ . run ( ) ;
20
+ run ( "bar" ) ;
21
+ }
You can’t perform that action at this time.
0 commit comments