Add a test that #[used]
makes it through to the linker on macos
This commit is contained in:
parent
54133cfcf4
commit
16c2b39e1c
2 changed files with 15 additions and 0 deletions
11
src/test/run-make-fulldeps/used-cdylib-macos/Makefile
Normal file
11
src/test/run-make-fulldeps/used-cdylib-macos/Makefile
Normal file
|
@ -0,0 +1,11 @@
|
|||
-include ../tools.mk
|
||||
|
||||
# only-macos
|
||||
#
|
||||
# This checks that `#[used]` passes through to the linker on
|
||||
# darwin. This is subject to change in the future, see
|
||||
# https://github.com/rust-lang/rust/pull/93718 for discussion
|
||||
|
||||
all:
|
||||
$(RUSTC) -Copt-level=3 dylib_used.rs
|
||||
nm $(TMPDIR)/libdylib_used.dylib | $(CGREP) VERY_IMPORTANT_SYMBOL
|
|
@ -0,0 +1,4 @@
|
|||
#![crate_type = "cdylib"]
|
||||
|
||||
#[used]
|
||||
static VERY_IMPORTANT_SYMBOL: u32 = 12345;
|
Loading…
Add table
Add a link
Reference in a new issue