From 08d18929fbd343cd46e8a8216c0c8d67f9763216 Mon Sep 17 00:00:00 2001 From: Erik Desjardins Date: Sat, 20 May 2023 01:30:59 -0400 Subject: [PATCH] align-byval test: add x86 x86 Windows also should not use byval since the struct is overaligned, see https://reviews.llvm.org/D72114 --- tests/codegen/align-byval.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/codegen/align-byval.rs b/tests/codegen/align-byval.rs index 4315c3371e19..1470e7bf782a 100644 --- a/tests/codegen/align-byval.rs +++ b/tests/codegen/align-byval.rs @@ -1,4 +1,4 @@ -// revisions:m68k wasm x86_64-linux x86_64-windows +// revisions:m68k wasm x86_64-linux x86_64-windows i686-linux i686-windows //[m68k] compile-flags: --target m68k-unknown-linux-gnu //[m68k] needs-llvm-components: m68k @@ -8,10 +8,13 @@ //[x86_64-linux] needs-llvm-components: x86 //[x86_64-windows] compile-flags: --target x86_64-pc-windows-msvc //[x86_64-windows] needs-llvm-components: x86 +//[i686-linux] compile-flags: --target i686-unknown-linux-gnu +//[i686-linux] needs-llvm-components: x86 +//[i686-windows] compile-flags: --target i686-pc-windows-msvc +//[i686-windows] needs-llvm-components: x86 // Tests that `byval` alignment is properly specified (#80127). -// The only targets that use `byval` are m68k, wasm, x86-64, and x86. Note that -// x86 has special rules (see #103830), and it's therefore ignored here. +// The only targets that use `byval` are m68k, wasm, x86-64, and x86. // Note also that Windows mandates a by-ref ABI here, so it does not use byval. #![feature(no_core, lang_items)] @@ -43,6 +46,12 @@ extern "C" { // x86_64-windows: declare void @f( // x86_64-windows-NOT: byval // x86_64-windows-SAME: align 16{{.*}}) + + // i686-linux: declare void @f({{.*}}byval(%Foo) align 4{{.*}}) + + // i686-windows: declare void @f( + // i686-windows-NOT: byval + // i686-windows-SAME: align 16{{.*}}) fn f(foo: Foo); }