File tree 3 files changed +48
-0
lines changed
src/test/run-make/linker-output-non-utf8 3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ -include ../tools.mk
2
+
3
+ # Make sure we don't ICE if the linker prints a non-UTF-8 error message.
4
+
5
+ # The zzz it to allow humans to tab complete or glob this thing.
6
+ bad_dir := $(TMPDIR ) /zzz$$'\xff'
7
+
8
+ all :
9
+ $(RUSTC ) library.rs
10
+ mkdir $(bad_dir )
11
+ mv $(TMPDIR ) /liblibrary.a $(bad_dir )
12
+ LIBRARY_PATH=$(bad_dir ) $(RUSTC ) exec.rs 2>&1 | grep this_symbol_not_defined
Original file line number Diff line number Diff line change
1
+ // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ #[ link( name="library" ) ]
12
+ extern "C" {
13
+ fn foo ( ) ;
14
+ }
15
+
16
+ fn main ( ) { unsafe { foo ( ) ; } }
Original file line number Diff line number Diff line change
1
+ // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ #![ crate_type = "staticlib" ]
12
+
13
+ extern "C" {
14
+ fn this_symbol_not_defined ( ) ;
15
+ }
16
+
17
+ #[ no_mangle]
18
+ pub extern "C" fn foo ( ) {
19
+ unsafe { this_symbol_not_defined ( ) ; }
20
+ }
You can’t perform that action at this time.
0 commit comments