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 {
72
72
extern "C" fn naked_external_linkage ( ) -> u32 {
73
73
unsafe { asm ! ( "mov rax, 42" , "ret" , options( noreturn) ) }
74
74
}
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() {
25
25
rustc ( ) . arg ( "-Zshare-generics=yes" ) . input ( "a_rust_dylib.rs" ) . run ( ) ;
26
26
global_function ( & rdylib_name, "public_vanilla_generic_function_from_rust_dylib" ) ;
27
27
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" ) ;
28
33
}
29
34
30
35
#[ track_caller]
You can’t perform that action at this time.
0 commit comments