From 0670d023f8a4694009de32cdf70b54106481ef36 Mon Sep 17 00:00:00 2001 From: Jonathan Brouwer Date: Thu, 12 Nov 2026 11:59:42 +0100 Subject: [PATCH] Revert "fix incorrect byte count suffix on MSVC" This reverts commit 62746359572280748adec7b4add65f0a1c26d1a9, reversing changes made to a7e0b2e4dfb535a375c7c55173f0e28474a876a0. --- compiler/rustc_codegen_llvm/src/declare.rs | 13 ---- compiler/rustc_codegen_ssa/src/back/lto.rs | 8 +-- .../src/back/symbol_export.rs | 70 ++++++------------- compiler/rustc_codegen_ssa/src/common.rs | 55 +-------------- .../assembly-llvm/win32-byte-count-suffix.rs | 11 +-- tests/codegen-llvm/abi-x86_64-win-zst.rs | 23 ++---- .../msvc-x86-callconv-byte-count.rs | 46 ------------ .../unwind-abis/fastcall-unwind-abi.rs | 4 +- .../unwind-abis/stdcall-unwind-abi.rs | 4 +- .../unwind-abis/system-unwind-abi.rs | 4 +- .../unwind-abis/vectorcall-unwind-abi.rs | 4 +- .../linking/msvc-callconv-export-prefixes.rs | 37 ---------- 12 files changed, 45 insertions(+), 234 deletions(-) delete mode 100644 tests/codegen-llvm/msvc-x86-callconv-byte-count.rs delete mode 100644 tests/ui/linking/msvc-callconv-export-prefixes.rs diff --git a/compiler/rustc_codegen_llvm/src/declare.rs b/compiler/rustc_codegen_llvm/src/declare.rs index a0c9faf47a1a5..37ffb92aac75e 100644 --- a/compiler/rustc_codegen_llvm/src/declare.rs +++ b/compiler/rustc_codegen_llvm/src/declare.rs @@ -169,19 +169,6 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> { instance: Option>, ) -> &'ll Value { debug!("declare_rust_fn(name={:?}, fn_abi={:?})", name, fn_abi); - // Some calling conventions (such as fastcall and vectorcall) decorate - // symbols with the argument byte count. Use rustc's original argument - // layouts and prefix the decorated name with `\x01` so LLVM does not - // decorate it a second time. - let decorated_name = rustc_codegen_ssa::common::windows_calling_convention_name( - &self.tcx.sess.target, - fn_abi.conv, - name, - &fn_abi.args, - ) - .map(|name| format!("\x01{name}")); - - let name = decorated_name.as_deref().unwrap_or(name); // Function addresses in Rust are never significant, allowing functions to // be merged. diff --git a/compiler/rustc_codegen_ssa/src/back/lto.rs b/compiler/rustc_codegen_ssa/src/back/lto.rs index c85ebe07b2c6b..a1de6b709cd92 100644 --- a/compiler/rustc_codegen_ssa/src/back/lto.rs +++ b/compiler/rustc_codegen_ssa/src/back/lto.rs @@ -12,7 +12,7 @@ use rustc_session::config::Lto; use rustc_structures::CrateType; use tracing::info; -use crate::back::symbol_export::{self, allocator_shim_symbols}; +use crate::back::symbol_export::{self, allocator_shim_symbols, symbol_name_for_instance_in_crate}; use crate::back::write::CodegenContext; use crate::base::allocator_kind_for_codegen; use crate::diagnostics::{DynamicLinkingWithLTO, LtoDisallowed, LtoDylib, LtoProcMacro}; @@ -104,11 +104,11 @@ pub(crate) fn exported_symbols_for_lto( tcx.exported_non_generic_symbols(cnum) .iter() .chain(tcx.exported_generic_symbols(cnum)) - .flat_map(|&(s, info): &(ExportedSymbol<'_>, SymbolExportInfo)| { + .filter_map(|&(s, info): &(ExportedSymbol<'_>, SymbolExportInfo)| { if info.level.is_below_threshold(export_threshold) || info.used { - symbol_export::symbol_names_for_lto(tcx, s, cnum) + Some(symbol_name_for_instance_in_crate(tcx, s, cnum)) } else { - vec![] + None } }) .collect::>() diff --git a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs index 6b9214b0b55fb..e2acf1fdcf69b 100644 --- a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs +++ b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs @@ -1,7 +1,7 @@ use std::collections::hash_map::Entry::*; use object::pe; -use rustc_abi::CanonAbi; +use rustc_abi::{CanonAbi, X86Call}; use rustc_ast::expand::allocator::{AllocatorKind, NO_ALLOC_SHIM_IS_UNSTABLE, global_fn_name}; use rustc_crate_store::CrateDepKind; use rustc_data_structures::fx::FxHashSet; @@ -758,31 +758,9 @@ fn calling_convention_for_symbol<'tcx>( .unwrap_or((CanonAbi::Rust, &[])) } -/// Names used to preserve an exported symbol during LTO. -/// -/// The restriction pass matches LLVM IR names, which retain the `\x01` -/// marker for explicitly decorated symbols. ThinLTO GUIDs instead use -/// the identifier without that marker, so preserve both spellings. -pub(crate) fn symbol_names_for_lto<'tcx>( - tcx: TyCtxt<'tcx>, - symbol: ExportedSymbol<'tcx>, - instantiating_crate: CrateNum, -) -> Vec { - let name = symbol_name_for_instance_in_crate(tcx, symbol, instantiating_crate); - let (callconv, args) = calling_convention_for_symbol(tcx, symbol); - - if let Some(decorated) = - crate::common::windows_calling_convention_name(&tcx.sess.target, callconv, &name, args) - { - vec![format!("\x01{decorated}"), decorated] - } else { - vec![name] - } -} /// This is the symbol name of the given instance as seen by the linker. /// -/// On Windows, symbols are decorated according to their calling conventions. -/// Vectorcall symbols are also decorated on non-Windows targets. +/// On 32-bit Windows symbols are decorated according to their calling conventions. pub(crate) fn linking_symbol_name_for_instance_in_crate<'tcx>( tcx: TyCtxt<'tcx>, symbol: ExportedSymbol<'tcx>, @@ -799,15 +777,8 @@ pub(crate) fn linking_symbol_name_for_instance_in_crate<'tcx>( let target = &tcx.sess.target; if !target.is_like_windows { - let (callconv, args) = calling_convention_for_symbol(tcx, symbol); - if let Some(name) = - crate::common::windows_calling_convention_name(target, callconv, &undecorated, args) - { - return name; - } - // Mach-O has a global "_" suffix and `object` crate will handle it. - // Other calling conventions do not need decoration here. + // ELF does not have any symbol decorations. return undecorated; } @@ -820,26 +791,27 @@ pub(crate) fn linking_symbol_name_for_instance_in_crate<'tcx>( _ => return undecorated, }; - // LLVM treats names beginning with '\x01' as already mangled and strips that prefix. - // Names beginning with '?' are left undecorated by LLVM; the prefix is kept. - if let Some(name) = undecorated.strip_prefix('\x01') { - return name.to_string(); - } - if undecorated.starts_with('?') { - return undecorated; - } let (callconv, args) = calling_convention_for_symbol(tcx, symbol); - if let Some(name) = - crate::common::windows_calling_convention_name(target, callconv, &undecorated, args) - { - return name; - } + // Decorate symbols with prefixes, suffixes and total number of bytes of arguments. + // Reference: https://docs.microsoft.com/en-us/cpp/build/reference/decorated-names?view=msvc-170 + let (prefix, suffix) = match callconv { + CanonAbi::X86(X86Call::Fastcall) => ("@", "@"), + CanonAbi::X86(X86Call::Stdcall) => ("_", "@"), + CanonAbi::X86(X86Call::Vectorcall) => ("", "@@"), + _ => { + if let Some(prefix) = prefix { + undecorated.insert(0, prefix); + } + return undecorated; + } + }; - if let Some(prefix) = prefix { - undecorated.insert(0, prefix); - } - undecorated + let args_in_bytes: u64 = args + .iter() + .map(|abi| abi.layout.size.bytes().next_multiple_of(target.pointer_width as u64 / 8)) + .sum(); + format!("{prefix}{undecorated}{suffix}{args_in_bytes}") } pub(crate) fn exporting_symbol_name_for_instance_in_crate<'tcx>( diff --git a/compiler/rustc_codegen_ssa/src/common.rs b/compiler/rustc_codegen_ssa/src/common.rs index 8b00f8a32182a..b5f1fee9407f4 100644 --- a/compiler/rustc_codegen_ssa/src/common.rs +++ b/compiler/rustc_codegen_ssa/src/common.rs @@ -1,15 +1,13 @@ #![allow(non_camel_case_types)] -use rustc_abi::{CanonAbi, X86Call}; use rustc_attr_ir::PeImportNameType; use rustc_attr_ir::lang_items::LangItem; use rustc_crate_store::{DllCallingConvention, DllImport, DllImportSymbolType}; use rustc_middle::mir::interpret::{GlobalAlloc, PointerArithmetic, Scalar}; use rustc_middle::ty::layout::TyAndLayout; -use rustc_middle::ty::{self, Instance, ScalarInt, Ty, TyCtxt}; +use rustc_middle::ty::{self, Instance, ScalarInt, TyCtxt}; use rustc_span::{Span, bug, span_bug}; -use rustc_target::callconv::ArgAbi; -use rustc_target::spec::{Arch, CfgAbi, Env, Os, Target}; +use rustc_target::spec::{CfgAbi, Env, Os, Target}; use crate::traits::*; @@ -176,55 +174,6 @@ pub fn is_using_dlltool(target: &Target) -> bool { target.os == Os::Windows && target.env == Env::Gnu && target.cfg_abi == CfgAbi::Unspecified } -/// Computes the total argument size used for Windows calling-convention -/// symbol decoration. Each argument is rounded up to the pointer width. -fn windows_abi_argument_byte_sum<'tcx>(args: &[ArgAbi<'tcx, Ty<'tcx>>], target: &Target) -> u64 { - let pointer_bytes = target.pointer_width as u64 / 8; - - args.iter().map(|arg| arg.layout.size.bytes().next_multiple_of(pointer_bytes)).sum() -} - -/// Computes the linker-visible decorated symbol name for supported Windows -/// calling conventions using the original `FnAbi` argument layouts. -/// Vectorcall is also decorated on non-Windows targets. -/// -/// The byte count is computed before backend-specific argument lowering, -/// which may replace indirectly passed arguments with pointers. -/// -/// For example, on 32-bit Windows, `extern "fastcall" fn foo(i32, i32)` -/// is decorated as `@foo@8`. On 64-bit targets, -/// `extern "vectorcall" fn foo(i32)` is decorated as `foo@@8`. -/// -/// Returns `None` if no decoration is required or if the name begins with -/// `\x01` or `?`, indicating that it must not be decorated further. -/// -/// This function does not add LLVM's `\x01` escape prefix. Backend-specific -/// handling of that marker is the responsibility of the caller. -pub fn windows_calling_convention_name<'tcx>( - target: &Target, - conv: CanonAbi, - name: &str, - args: &[ArgAbi<'tcx, Ty<'tcx>>], -) -> Option { - if !target.is_like_windows && conv != CanonAbi::X86(X86Call::Vectorcall) { - return None; - } - - if name.starts_with('\x01') || name.starts_with('?') { - return None; - } - - let (prefix, suffix) = match (&target.arch, conv) { - (Arch::X86, CanonAbi::X86(X86Call::Fastcall)) => ("@", "@"), - (Arch::X86, CanonAbi::X86(X86Call::Stdcall)) => ("_", "@"), - (Arch::X86 | Arch::X86_64, CanonAbi::X86(X86Call::Vectorcall)) => ("", "@@"), - _ => return None, - }; - - let args_in_bytes = windows_abi_argument_byte_sum(args, target); - Some(format!("{prefix}{name}{suffix}{args_in_bytes}")) -} - pub fn i686_decorated_name( dll_import: &DllImport, mingw: bool, diff --git a/tests/assembly-llvm/win32-byte-count-suffix.rs b/tests/assembly-llvm/win32-byte-count-suffix.rs index 14d90e2d4eea2..83b01c62dca85 100644 --- a/tests/assembly-llvm/win32-byte-count-suffix.rs +++ b/tests/assembly-llvm/win32-byte-count-suffix.rs @@ -249,8 +249,9 @@ extern "vectorcall" fn eight_vectors_vectorcall( ) { } -// MSVC passes this argument indirectly, but the decoration uses the -// original 8-byte type size rather than the 4-byte pointer size. +/// FIXME: the mangled name for this type is incorrect on msvc, where the argument is passed +/// indirectly and a pointer takes up 4 bytes, but clang counts the size of the type and uses +/// @8 there. With GNU the value is passed directly, so the suffix is correct. #[repr(C, align(8))] struct OverAligned(u32, u32); @@ -259,16 +260,16 @@ struct OverAligned(u32, u32); extern "C" fn overaligned(_: OverAligned) {} // windows-gnu-LABEL: _overaligned_stdcall@8: -// windows-msvc-LABEL: _overaligned_stdcall@8: +// windows-msvc-LABEL: _overaligned_stdcall@4: #[unsafe(no_mangle)] extern "stdcall" fn overaligned_stdcall(_: OverAligned) {} // windows-gnu-LABEL: @overaligned_fastcall@8: -// windows-msvc-LABEL: @overaligned_fastcall@8: +// windows-msvc-LABEL: @overaligned_fastcall@4: #[unsafe(no_mangle)] extern "fastcall" fn overaligned_fastcall(_: OverAligned) {} // windows-gnu-LABEL: overaligned_vectorcall@@8: -// windows-msvc-LABEL: overaligned_vectorcall@@8: +// windows-msvc-LABEL: overaligned_vectorcall@@4: #[unsafe(no_mangle)] extern "vectorcall" fn overaligned_vectorcall(_: OverAligned) {} diff --git a/tests/codegen-llvm/abi-x86_64-win-zst.rs b/tests/codegen-llvm/abi-x86_64-win-zst.rs index 52a81b661b5ec..bcb275a78bb82 100644 --- a/tests/codegen-llvm/abi-x86_64-win-zst.rs +++ b/tests/codegen-llvm/abi-x86_64-win-zst.rs @@ -43,15 +43,15 @@ extern "win64" fn pass_c_maybezst_win64(_: CMaybeZst) {} #[no_mangle] extern "win64" fn pass_c_maybezst_2_win64(_: CMaybeZst2) {} -// CHECK: define x86_vectorcallcc void @"\01pass_rust_zst_vectorcall@@0"( +// CHECK: define x86_vectorcallcc void @pass_rust_zst_vectorcall() #[no_mangle] extern "vectorcall" fn pass_rust_zst_vectorcall(_: ()) {} -// CHECK: define x86_vectorcallcc void @"\01pass_c_maybezst_vectorcall@@0"(ptr {{[^,]*}}) +// CHECK: define x86_vectorcallcc void @pass_c_maybezst_vectorcall(ptr {{[^,]*}}) #[no_mangle] extern "vectorcall" fn pass_c_maybezst_vectorcall(_: CMaybeZst) {} -// CHECK: define x86_vectorcallcc void @"\01pass_c_maybezst_2_vectorcall@@0"(ptr {{[^,]*}}) +// CHECK: define x86_vectorcallcc void @pass_c_maybezst_2_vectorcall(ptr {{[^,]*}}) #[no_mangle] extern "vectorcall" fn pass_c_maybezst_2_vectorcall(_: CMaybeZst2) {} @@ -73,21 +73,6 @@ extern "fastcall" fn pass_c_maybezst_fastcall(_: CMaybeZst) {} #[cfg(windows)] // "fastcall" is not valid on 64bit Linux extern "fastcall" fn pass_c_maybezst_2_fastcall(_: CMaybeZst2) {} -// Keep the original argument size when a vectorcall argument is passed -// indirectly. This also exercises vectorcall decoration on Linux. -#[repr(C)] -pub struct Big { - pub data: [u64; 4], -} - -// CHECK: define x86_vectorcallcc void @"\01vc_big@@32"( -#[unsafe(export_name = "vc_big")] -pub extern "vectorcall" fn vc_big(_: Big) {} - -// CHECK: define x86_vectorcallcc void @"\01vc_u64@@8"( -#[unsafe(export_name = "vc_u64")] -pub extern "vectorcall" fn vc_u64(_: u64) {} - // The sysv64 ABI ignores ZST. // CHECK: define x86_64_sysvcc void @pass_rust_zst_sysv64() @@ -131,7 +116,7 @@ extern "win64" fn ret_c_maybezst_win64() -> CMaybeZst { CMaybeZst } -// CHECK: define x86_vectorcallcc void @"\01ret_c_maybezst_vectorcall@@0"(ptr {{[^,]*}}) +// CHECK: define x86_vectorcallcc void @ret_c_maybezst_vectorcall(ptr {{[^,]*}}) #[no_mangle] extern "vectorcall" fn ret_c_maybezst_vectorcall() -> CMaybeZst { CMaybeZst diff --git a/tests/codegen-llvm/msvc-x86-callconv-byte-count.rs b/tests/codegen-llvm/msvc-x86-callconv-byte-count.rs deleted file mode 100644 index ac867b9fa9a80..0000000000000 --- a/tests/codegen-llvm/msvc-x86-callconv-byte-count.rs +++ /dev/null @@ -1,46 +0,0 @@ -// Regression test for rust-lang/rust#165299. -// Verify decoration using source argument layouts on 32-bit Windows. -// -//@ add-minicore -//@ revisions: msvc gnu -//@[msvc] compile-flags: --target i686-pc-windows-msvc -//@[gnu] compile-flags: --target i686-pc-windows-gnu -//@ needs-llvm-components: x86 - -#![feature(abi_vectorcall, no_core)] -#![no_core] -#![crate_type = "lib"] - -extern crate minicore; -use minicore::*; - -#[repr(C)] -pub struct Big { - pub data: [u64; 4], -} - -// CHECK-DAG: @"\01@fast_big@32" -#[unsafe(export_name = "fast_big")] -pub extern "fastcall" fn fast_big(_: Big) {} - -// CHECK-DAG: @"\01_std_big@32" -#[unsafe(export_name = "std_big")] -pub extern "stdcall" fn std_big(_: Big) {} - -// CHECK-DAG: @"\01vec_big@@32" -#[unsafe(export_name = "vec_big")] -pub extern "vectorcall" fn vec_big(_: Big) {} - -// CHECK-DAG: @"\01vec_u64@@8" -#[unsafe(export_name = "vec_u64")] -pub extern "vectorcall" fn vec_u64(_: u64) {} - -// Names beginning with '?' are already decorated. -// CHECK-DAG: @"?special" -#[unsafe(export_name = "?special")] -pub extern "stdcall" fn question(_: u32) {} - -// The LLVM escape prefix must not acquire another decoration. -// CHECK-DAG: @"\01special" -#[unsafe(export_name = "\x01special")] -pub extern "stdcall" fn escaped(_: u32) {} diff --git a/tests/codegen-llvm/unwind-abis/fastcall-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/fastcall-unwind-abi.rs index b0b5924443a65..51c6fd15b9c5c 100644 --- a/tests/codegen-llvm/unwind-abis/fastcall-unwind-abi.rs +++ b/tests/codegen-llvm/unwind-abis/fastcall-unwind-abi.rs @@ -16,11 +16,11 @@ pub trait Sized: MetaSized {} // `fastcall-unwind` extern functions. `fastcall-unwind` functions MUST NOT have this attribute. We // disable optimizations above to prevent LLVM from inferring the attribute. -// CHECK: @"\01@rust_item_that_cannot_unwind@0"() unnamed_addr #0 +// CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 #[no_mangle] pub extern "fastcall" fn rust_item_that_cannot_unwind() {} -// CHECK: @"\01@rust_item_that_can_unwind@0"() unnamed_addr #1 +// CHECK: @rust_item_that_can_unwind() unnamed_addr #1 #[no_mangle] pub extern "fastcall-unwind" fn rust_item_that_can_unwind() {} diff --git a/tests/codegen-llvm/unwind-abis/stdcall-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/stdcall-unwind-abi.rs index 7cd06eb4e0fc9..b5fcea52b4d61 100644 --- a/tests/codegen-llvm/unwind-abis/stdcall-unwind-abi.rs +++ b/tests/codegen-llvm/unwind-abis/stdcall-unwind-abi.rs @@ -16,11 +16,11 @@ pub trait Sized: MetaSized {} // extern functions. `stdcall-unwind` functions MUST NOT have this attribute. We disable // optimizations above to prevent LLVM from inferring the attribute. -// CHECK: @"\01_rust_item_that_cannot_unwind@0"() unnamed_addr #0 +// CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 #[no_mangle] pub extern "stdcall" fn rust_item_that_cannot_unwind() {} -// CHECK: @"\01_rust_item_that_can_unwind@0"() unnamed_addr #1 +// CHECK: @rust_item_that_can_unwind() unnamed_addr #1 #[no_mangle] pub extern "stdcall-unwind" fn rust_item_that_can_unwind() {} diff --git a/tests/codegen-llvm/unwind-abis/system-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/system-unwind-abi.rs index 59b05c04dc766..15fce95fe285b 100644 --- a/tests/codegen-llvm/unwind-abis/system-unwind-abi.rs +++ b/tests/codegen-llvm/unwind-abis/system-unwind-abi.rs @@ -7,11 +7,11 @@ #![crate_type = "lib"] -// CHECK: @{{.*}}rust_item_that_cannot_unwind{{.*}}() unnamed_addr #0 +// CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 #[no_mangle] pub extern "system" fn rust_item_that_cannot_unwind() {} -// CHECK: @{{.*}}rust_item_that_can_unwind{{.*}}() unnamed_addr #1 +// CHECK: @rust_item_that_can_unwind() unnamed_addr #1 #[no_mangle] pub extern "system-unwind" fn rust_item_that_can_unwind() {} diff --git a/tests/codegen-llvm/unwind-abis/vectorcall-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/vectorcall-unwind-abi.rs index 664ad73797437..8cedb55ae1d28 100644 --- a/tests/codegen-llvm/unwind-abis/vectorcall-unwind-abi.rs +++ b/tests/codegen-llvm/unwind-abis/vectorcall-unwind-abi.rs @@ -16,11 +16,11 @@ pub trait Sized: MetaSized {} // `vectorcall-unwind` extern functions. `vectorcall-unwind` functions MUST NOT have this attribute. // We disable optimizations above to prevent LLVM from inferring the attribute. -// CHECK: @"\01rust_item_that_cannot_unwind@@0"() unnamed_addr #0 +// CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 #[no_mangle] pub extern "vectorcall" fn rust_item_that_cannot_unwind() {} -// CHECK: @"\01rust_item_that_can_unwind@@0"() unnamed_addr #1 +// CHECK: @rust_item_that_can_unwind() unnamed_addr #1 #[no_mangle] pub extern "vectorcall-unwind" fn rust_item_that_can_unwind() {} diff --git a/tests/ui/linking/msvc-callconv-export-prefixes.rs b/tests/ui/linking/msvc-callconv-export-prefixes.rs deleted file mode 100644 index 6dc7332fba847..0000000000000 --- a/tests/ui/linking/msvc-callconv-export-prefixes.rs +++ /dev/null @@ -1,37 +0,0 @@ -// Regression test for rust-lang/rust#165299. -// -// Cross-compile a Windows MSVC cdylib and link it to check that the -// linker-visible names agree with the names emitted by LLVM. -// -// `minicore` avoids requiring a Windows target sysroot, while rust-lld -// allows this test to link on non-Windows hosts. `/NOENTRY` avoids needing -// a DLL entry point or Windows startup libraries. -// -// Check normal vectorcall decoration and names explicitly marked as -// already decorated with either `\x01` or `?`. - -//@ build-pass -//@ add-minicore -//@ revisions: i686 x86_64 -//@[i686] compile-flags: --target i686-pc-windows-msvc -//@[x86_64] compile-flags: --target x86_64-pc-windows-msvc -//@ compile-flags: -Clinker=rust-lld -Clink-arg=/NOENTRY -Cpanic=abort -//@ needs-llvm-components: x86 -//@ needs-rust-lld -//@ ignore-backends: gcc - -#![feature(no_core, abi_vectorcall)] -#![no_core] -#![crate_type = "cdylib"] - -extern crate minicore; -use minicore::*; - -#[unsafe(export_name = "\x01ctl_vectorcall")] -pub extern "vectorcall" fn escaped(_: u32, _: u32) {} - -#[unsafe(export_name = "?q_vectorcall")] -pub extern "vectorcall" fn question(_: u32, _: u32) {} - -#[unsafe(export_name = "normal_vectorcall")] -pub extern "vectorcall" fn normal(_: u32, _: u32) {}