brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 83c66d7 Raw
44 lines · plain
1; RUN: llc -mtriple=hexagon -mcpu=hexagonv65 < %s | FileCheck %s2 3; C file was:4; struct S { int a[3];};5; void foo(int x, struct S arg1, struct S arg2);6; void bar() {7;  struct S s;8;  s.a[0] = 9;9;  foo(42, s, s);10; }11 12; Test that while passing a 12-byte struct on the stack, the13; struct is aligned to 4 bytes since its largest member is of type int.14; Previously, the struct was being aligned to 8 bytes15 16; CHECK: memw(r{{[0-9]+}}+#12) = #917 18; Check that the flag hexagon-disable-args-min-alignment works and the struct19; is aligned to 8 bytes.20; RUN: llc -mtriple=hexagon -mcpu=hexagonv65 -hexagon-disable-args-min-alignment < %s | FileCheck -check-prefix=HEXAGON_LEGACY %s21 22; HEXAGON_LEGACY: memw(r{{[0-9]+}}+#16) = #923 24%struct.S = type { [3 x i32] }25 26; Function Attrs: nounwind27define dso_local void @bar() local_unnamed_addr #0 {28entry:29  %s = alloca %struct.S, align 430  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %s) #331  store i32 9, ptr %s, align 432  tail call void @foo(i32 42, ptr nonnull byval(%struct.S) align 4 %s, ptr nonnull byval(%struct.S) align 4 %s) #333  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %s) #334  ret void35}36 37; Function Attrs: argmemonly nounwind willreturn38declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #139 40declare dso_local void @foo(i32, ptr byval(%struct.S) align 4, ptr byval(%struct.S) align 4) local_unnamed_addr #241 42; Function Attrs: argmemonly nounwind willreturn43declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #144