1; RUN: llc -march=hexagon -mcpu=hexagonv65 < %s | FileCheck %s
2; REQUIRES: hexagon
3
4; C file was:
5; struct S { char b; long long a; };
6; void foo(int x, struct S arg1);
7; void bar() {
8;   struct S s;
9;   s.b = 'a';
10;   foo(42, s);
11;}
12
13;
14; Test that while passing a 7-byte struct on the stack, the
15; size of the struct is 16 bytes including padding since its
16; largest member is of type long long. This was being handled
17; correctly but is a sanity check against any potential future
18; regressions.
19;
20
21; CHECK: memd(r{{[0-9]+}}+#8) =
22; CHECK: memd(r{{[0-9]+}}+#0) =
23
24%struct.S = type { i8, i64 }
25
26; Function Attrs: nounwind
27define dso_local void @bar() local_unnamed_addr #0 {
28entry:
29  %s = alloca %struct.S, align 8
30  %0 = getelementptr inbounds %struct.S, %struct.S* %s, i32 0, i32 0
31  call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %0) #3
32  store i8 97, i8* %0, align 8
33  tail call void @foo(i32 42, %struct.S* nonnull byval(%struct.S) align 8 %s) #3
34  call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %0) #3
35  ret void
36}
37
38; Function Attrs: argmemonly nounwind willreturn
39declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
40
41declare dso_local void @foo(i32, %struct.S* byval(%struct.S) align 8) local_unnamed_addr #2
42
43; Function Attrs: argmemonly nounwind willreturn
44declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
45
46