Fix dllimports of static data from rlibs
This commit is contained in:
parent
cefe5f25b2
commit
e82bb915e4
4 changed files with 106 additions and 32 deletions
8
src/test/run-make/msvc-data-only/Makefile
Normal file
8
src/test/run-make/msvc-data-only/Makefile
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# Test that on *-pc-windows-msvc we can link to a rlib containing only data.
|
||||
# See #26591, #27438
|
||||
|
||||
-include ../tools.mk
|
||||
|
||||
all:
|
||||
$(RUSTC) foo.rs
|
||||
$(RUSTC) bar.rs
|
||||
15
src/test/run-make/msvc-data-only/bar.rs
Normal file
15
src/test/run-make/msvc-data-only/bar.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern crate foo;
|
||||
|
||||
fn main() {
|
||||
println!("The answer is {} !", foo::FOO);
|
||||
}
|
||||
13
src/test/run-make/msvc-data-only/foo.rs
Normal file
13
src/test/run-make/msvc-data-only/foo.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![crate_type = "rlib"]
|
||||
|
||||
pub static FOO: i32 = 42;
|
||||
Loading…
Add table
Add a link
Reference in a new issue