Skip to content

Commit 4a8202c

Browse files
committed
Add testcase for proper LLVM representation of SIMD types.
Testcase to make sure that no 0-sized padding is inserted in structs and that structs are represented as expected by Neon intrinsics in LLVM.
1 parent 50be80b commit 4a8202c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/test/codegen/unpadded-simd.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Make sure that no 0-sized padding is inserted in structs and that
2+
// structs are represented as expected by Neon intrinsics in LLVM.
3+
// See #87254.
4+
5+
#![crate_type = "lib"]
6+
#![feature(repr_simd)]
7+
8+
#[derive(Copy, Clone, Debug)]
9+
#[repr(simd)]
10+
pub struct int16x4_t(pub i16, pub i16, pub i16, pub i16);
11+
12+
#[derive(Copy, Clone, Debug)]
13+
pub struct int16x4x2_t(pub int16x4_t, pub int16x4_t);
14+
// CHECK: %int16x4x2_t = type { <4 x i16>, <4 x i16> }

0 commit comments

Comments
 (0)