File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 1+ #![ feature( abi_vectorcall) ]
2+
3+ #[ no_mangle]
4+ #[ inline( never) ]
5+ pub extern "vectorcall" fn call_with_42 ( i : i32 ) {
6+ assert_eq ! ( i, 42 ) ;
7+ }
Original file line number Diff line number Diff line change 11//@ run-pass
2+ //@ aux-build:foreign-vectorcall.rs
23//@ revisions: x64 x32
34//@ [x64]only-x86_64
45//@ [x32]only-x86
56
67#![ feature( abi_vectorcall) ]
78
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 ( i32 ) ;
15+ }
16+
817trait A {
918 extern "vectorcall" fn test1 ( i : i32 ) ;
1019}
@@ -24,4 +33,5 @@ extern "vectorcall" fn test2(i: i32) {
2433fn main ( ) {
2534 <S as A >:: test1 ( 1 ) ;
2635 test2 ( 2 ) ;
36+ unsafe { call_with_42 ( 42 ) } ;
2737}
You can’t perform that action at this time.
0 commit comments