File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
test-cargo-miri/exported-symbol-dep/src
tests/run-pass/function_calls Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,11 @@ fn exported_symbol() -> i32 {
33 123456
44}
55
6- pub struct AssocFn ;
6+ struct AssocFn ;
77
88impl AssocFn {
99 #[ no_mangle]
10- pub fn assoc_fn_as_exported_symbol ( ) -> i32 {
10+ fn assoc_fn_as_exported_symbol ( ) -> i32 {
1111 -123456
1212 }
1313}
Original file line number Diff line number Diff line change @@ -15,6 +15,16 @@ fn baz() -> i32 {
1515 -3
1616}
1717
18+ struct AssocFn ;
19+
20+ impl AssocFn {
21+ #[ no_mangle]
22+ fn qux ( ) -> i32 {
23+ -4
24+ }
25+ }
26+
27+
1828fn main ( ) {
1929 // Repeat calls to make sure the `Instance` cache is not broken.
2030 for _ in 0 ..3 {
@@ -32,10 +42,12 @@ fn main() {
3242 extern "Rust" {
3343 fn bar ( ) -> i32 ;
3444 fn baz ( ) -> i32 ;
45+ fn qux ( ) -> i32 ;
3546 }
3647
3748 assert_eq ! ( unsafe { bar( ) } , -2 ) ;
3849 assert_eq ! ( unsafe { baz( ) } , -3 ) ;
50+ assert_eq ! ( unsafe { qux( ) } , -4 ) ;
3951
4052 #[ allow( clashing_extern_declarations) ]
4153 {
@@ -53,6 +65,7 @@ fn main() {
5365 extern "C" {
5466 fn bar ( ) -> i32 ;
5567 fn baz ( ) -> i32 ;
68+ fn qux ( ) -> i32 ;
5669 }
5770
5871 unsafe {
@@ -61,6 +74,7 @@ fn main() {
6174 } ;
6275 assert_eq ! ( transmute( bar) ( ) , -2 ) ;
6376 assert_eq ! ( transmute( baz) ( ) , -3 ) ;
77+ assert_eq ! ( transmute( qux) ( ) , -4 ) ;
6478 }
6579 }
6680 }
You can’t perform that action at this time.
0 commit comments