From 335bc4960980becdaf29bb7dd70aad81210d1830 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Tue, 20 Jul 2021 20:02:22 +0100 Subject: Force the use of sysv64 calling convention in x86_64 disassembly tests (#1187) This ensures that results are consistent across windows/linux tests. --- library/stdarch/crates/assert-instr-macro/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'library/stdarch/crates/assert-instr-macro/src') diff --git a/library/stdarch/crates/assert-instr-macro/src/lib.rs b/library/stdarch/crates/assert-instr-macro/src/lib.rs index ef76c1c0d42..5b25df7035f 100644 --- a/library/stdarch/crates/assert-instr-macro/src/lib.rs +++ b/library/stdarch/crates/assert-instr-macro/src/lib.rs @@ -114,7 +114,12 @@ pub fn assert_instr( // Use an ABI on Windows that passes SIMD values in registers, like what // happens on Unix (I think?) by default. let abi = if cfg!(windows) { - syn::LitStr::new("vectorcall", proc_macro2::Span::call_site()) + let target = std::env::var("TARGET").unwrap(); + if target.contains("x86_64") { + syn::LitStr::new("sysv64", proc_macro2::Span::call_site()) + } else { + syn::LitStr::new("vectorcall", proc_macro2::Span::call_site()) + } } else { syn::LitStr::new("C", proc_macro2::Span::call_site()) }; -- cgit 1.4.1-3-g733a5