File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
tests/run-make/naked-symbol-visibility Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -72,3 +72,16 @@ extern "C" fn naked_weak_linkage() -> u32 {
7272extern "C" fn naked_external_linkage ( ) -> u32 {
7373 unsafe { asm ! ( "mov rax, 42" , "ret" , options( noreturn) ) }
7474}
75+
76+ // functions that are declared in an `extern "C"` block are currently not exported
77+ // this maybe should change in the future, this is just tracking the current behavior
78+ // reported in https://github.com/rust-lang/rust/issues/128071
79+ std:: arch:: global_asm! {
80+ ".globl function_defined_in_global_asm" ,
81+ "function_defined_in_global_asm:" ,
82+ "ret" ,
83+ }
84+
85+ extern "C" {
86+ pub fn function_defined_in_global_asm ( ) ;
87+ }
Original file line number Diff line number Diff line change @@ -25,6 +25,11 @@ fn main() {
2525 rustc ( ) . arg ( "-Zshare-generics=yes" ) . input ( "a_rust_dylib.rs" ) . run ( ) ;
2626 global_function ( & rdylib_name, "public_vanilla_generic_function_from_rust_dylib" ) ;
2727 global_function ( & rdylib_name, "public_naked_generic_function_from_rust_dylib" ) ;
28+
29+ // functions that are declared in an `extern "C"` block are currently not exported
30+ // this maybe should change in the future, this is just tracking the current behavior
31+ // reported in https://github.com/rust-lang/rust/issues/128071
32+ not_exported ( & rdylib_name, "function_defined_in_global_asm" ) ;
2833}
2934
3035#[ track_caller]
You can’t perform that action at this time.
0 commit comments