File tree 2 files changed +20
-0
lines changed
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Make the aux build not use `dylib` to avoid https://github.com/rust-lang/rust/issues/130196
2
+ //@ no-prefer-dynamic
3
+ #![ feature( abi_vectorcall) ]
4
+ #![ crate_type = "lib" ]
5
+
6
+ #[ no_mangle]
7
+ #[ inline( never) ]
8
+ pub extern "vectorcall" fn call_with_42 ( i : i32 ) {
9
+ assert_eq ! ( i, 42 ) ;
10
+ }
Original file line number Diff line number Diff line change 1
1
//@ run-pass
2
+ //@ aux-build:foreign-vectorcall.rs
2
3
//@ revisions: x64 x32
3
4
//@ [x64]only-x86_64
4
5
//@ [x32]only-x86
5
6
6
7
#![ feature( abi_vectorcall) ]
7
8
9
+ extern crate foreign_vectorcall;
10
+
11
+ // Import this as a foreign function, that's the code path we are interested in
12
+ // (LLVM has to do some name mangling here).
13
+ extern "vectorcall" {
14
+ fn call_with_42 ( i : i32 ) ;
15
+ }
16
+
8
17
trait A {
9
18
extern "vectorcall" fn test1 ( i : i32 ) ;
10
19
}
@@ -24,4 +33,5 @@ extern "vectorcall" fn test2(i: i32) {
24
33
fn main ( ) {
25
34
<S as A >:: test1 ( 1 ) ;
26
35
test2 ( 2 ) ;
36
+ unsafe { call_with_42 ( 42 ) } ;
27
37
}
You can’t perform that action at this time.
0 commit comments