Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a test that #[used] makes it through to the linker on macos
  • Loading branch information
thomcc committed May 11, 2022
commit 16c2b39e1c5029913daf7b780c2cbea7477e077c
11 changes: 11 additions & 0 deletions src/test/run-make-fulldeps/used-cdylib-macos/Makefile
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions src/test/run-make-fulldeps/used-cdylib-macos/dylib_used.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#![crate_type = "cdylib"]

#[used]
static VERY_IMPORTANT_SYMBOL: u32 = 12345;