File tree Expand file tree Collapse file tree 4 files changed +27
-12
lines changed
tests/run-make/metadata-flag-frobs-symbols Expand file tree Collapse file tree 4 files changed +27
-12
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,12 @@ impl Rustc {
7373 self
7474 }
7575
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+
7682 /// Add a suffix in each output filename.
7783 pub fn extra_filename ( & mut self , suffix : & str ) -> & mut Self {
7884 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
119119run-make/manual-link/Makefile
120120run-make/many-crates-but-no-match/Makefile
121121run-make/metadata-dep-info/Makefile
122- run-make/metadata-flag-frobs-symbols/Makefile
123122run-make/min-global-align/Makefile
124123run-make/mingw-export-call-convention/Makefile
125124run-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