File tree 2 files changed +16
-2
lines changed
test-cargo-miri/exported-symbol-dep/src
tests/run-pass/function_calls 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 {
3
3
123456
4
4
}
5
5
6
- pub struct AssocFn ;
6
+ struct AssocFn ;
7
7
8
8
impl AssocFn {
9
9
#[ no_mangle]
10
- pub fn assoc_fn_as_exported_symbol ( ) -> i32 {
10
+ fn assoc_fn_as_exported_symbol ( ) -> i32 {
11
11
-123456
12
12
}
13
13
}
Original file line number Diff line number Diff line change @@ -15,6 +15,16 @@ fn baz() -> i32 {
15
15
-3
16
16
}
17
17
18
+ struct AssocFn ;
19
+
20
+ impl AssocFn {
21
+ #[ no_mangle]
22
+ fn qux ( ) -> i32 {
23
+ -4
24
+ }
25
+ }
26
+
27
+
18
28
fn main ( ) {
19
29
// Repeat calls to make sure the `Instance` cache is not broken.
20
30
for _ in 0 ..3 {
@@ -32,10 +42,12 @@ fn main() {
32
42
extern "Rust" {
33
43
fn bar ( ) -> i32 ;
34
44
fn baz ( ) -> i32 ;
45
+ fn qux ( ) -> i32 ;
35
46
}
36
47
37
48
assert_eq ! ( unsafe { bar( ) } , -2 ) ;
38
49
assert_eq ! ( unsafe { baz( ) } , -3 ) ;
50
+ assert_eq ! ( unsafe { qux( ) } , -4 ) ;
39
51
40
52
#[ allow( clashing_extern_declarations) ]
41
53
{
@@ -53,6 +65,7 @@ fn main() {
53
65
extern "C" {
54
66
fn bar ( ) -> i32 ;
55
67
fn baz ( ) -> i32 ;
68
+ fn qux ( ) -> i32 ;
56
69
}
57
70
58
71
unsafe {
@@ -61,6 +74,7 @@ fn main() {
61
74
} ;
62
75
assert_eq ! ( transmute( bar) ( ) , -2 ) ;
63
76
assert_eq ! ( transmute( baz) ( ) , -3 ) ;
77
+ assert_eq ! ( transmute( qux) ( ) , -4 ) ;
64
78
}
65
79
}
66
80
}
You can’t perform that action at this time.
0 commit comments