1 ; RUN: llc -march=hexagon -mcpu=hexagonv65 < %s | FileCheck %s
4 ; struct S { int a[3];};
5 ; void foo(int x, struct S arg1, struct S arg2);
12 ; Test that while passing a 12-byte struct on the stack, the
13 ; struct is aligned to 4 bytes since its largest member is of type int.
14 ; Previously, the struct was being aligned to 8 bytes
16 ; CHECK: memw(r{{[0-9]+}}+#12) = #9
18 ; Check that the flag hexagon-disable-args-min-alignment works and the struct
19 ; is aligned to 8 bytes.
20 ; RUN: llc -march=hexagon -mcpu=hexagonv65 -hexagon-disable-args-min-alignment < %s | FileCheck -check-prefix=HEXAGON_LEGACY %s
22 ; HEXAGON_LEGACY: memw(r{{[0-9]+}}+#16) = #9
24 %struct.S = type { [3 x i32] }
26 ; Function Attrs: nounwind
27 define dso_local void @bar() local_unnamed_addr #0 {
29 %s = alloca %struct.S, align 4
30 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %s) #3
31 store i32 9, ptr %s, align 4
32 tail call void @foo(i32 42, ptr nonnull byval(%struct.S) align 4 %s, ptr nonnull byval(%struct.S) align 4 %s) #3
33 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %s) #3
37 ; Function Attrs: argmemonly nounwind willreturn
38 declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
40 declare dso_local void @foo(i32, ptr byval(%struct.S) align 4, ptr byval(%struct.S) align 4) local_unnamed_addr #2
42 ; Function Attrs: argmemonly nounwind willreturn
43 declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1