1 // Verify linkage of external symbols in the static relocation model on MSVC.
3 // compile-flags: -O -C relocation-model=static
4 // aux-build: extern_decl.rs
5 // only-x86_64-pc-windows-msvc
7 #![crate_type = "rlib"]
9 extern crate extern_decl;
11 // The `extern_decl` definitions are imported from a statically linked rust
12 // crate, thus they are expected to be marked `dso_local` without `dllimport`.
14 // The `access_extern()` symbol is from this compilation unit, thus we expect
15 // it to be marked `dso_local` as well, given the static relocation model.
17 // CHECK: @extern_static = external dso_local local_unnamed_addr global i8
18 // CHECK: define dso_local i8 @access_extern() {{.*}}
19 // CHECK: declare dso_local i8 @extern_fn() {{.*}}
22 pub fn access_extern() -> u8 {
24 extern_decl::extern_fn() + extern_decl::extern_static