Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 08d1892

Browse files
align-byval test: add x86
x86 Windows also should not use byval since the struct is overaligned, see https://reviews.llvm.org/D72114
1 parent bc9d26a commit 08d1892

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

tests/codegen/align-byval.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// revisions:m68k wasm x86_64-linux x86_64-windows
1+
// revisions:m68k wasm x86_64-linux x86_64-windows i686-linux i686-windows
22

33
//[m68k] compile-flags: --target m68k-unknown-linux-gnu
44
//[m68k] needs-llvm-components: m68k
@@ -8,10 +8,13 @@
88
//[x86_64-linux] needs-llvm-components: x86
99
//[x86_64-windows] compile-flags: --target x86_64-pc-windows-msvc
1010
//[x86_64-windows] needs-llvm-components: x86
11+
//[i686-linux] compile-flags: --target i686-unknown-linux-gnu
12+
//[i686-linux] needs-llvm-components: x86
13+
//[i686-windows] compile-flags: --target i686-pc-windows-msvc
14+
//[i686-windows] needs-llvm-components: x86
1115

1216
// Tests that `byval` alignment is properly specified (#80127).
13-
// The only targets that use `byval` are m68k, wasm, x86-64, and x86. Note that
14-
// x86 has special rules (see #103830), and it's therefore ignored here.
17+
// The only targets that use `byval` are m68k, wasm, x86-64, and x86.
1518
// Note also that Windows mandates a by-ref ABI here, so it does not use byval.
1619

1720
#![feature(no_core, lang_items)]
@@ -43,6 +46,12 @@ extern "C" {
4346
// x86_64-windows: declare void @f(
4447
// x86_64-windows-NOT: byval
4548
// x86_64-windows-SAME: align 16{{.*}})
49+
50+
// i686-linux: declare void @f({{.*}}byval(%Foo) align 4{{.*}})
51+
52+
// i686-windows: declare void @f(
53+
// i686-windows-NOT: byval
54+
// i686-windows-SAME: align 16{{.*}})
4655
fn f(foo: Foo);
4756
}
4857

0 commit comments

Comments
 (0)