We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 454b281 commit 7642197Copy full SHA for 7642197
tests/ui/extern/auxiliary/foreign-vectorcall.rs
@@ -0,0 +1,7 @@
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
+}
tests/ui/extern/extern-vectorcall.rs
@@ -1,10 +1,19 @@
//@ run-pass
+//@ aux-build:foreign-vectorcall.rs
//@ revisions: x64 x32
//@ [x64]only-x86_64
//@ [x32]only-x86
#![feature(abi_vectorcall)]
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(i32);
15
16
17
trait A {
18
extern "vectorcall" fn test1(i: i32);
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
0 commit comments