xref: /llvm-project/llvm/test/CodeGen/PowerPC/byval-aliased.ll (revision 427fb35192f1f7bb694a5910b05abc5925a798b2)
1; RUN: llc -verify-machineinstrs -mcpu=ppc64 -ppc-asm-full-reg-names < %s | FileCheck %s
2target datalayout = "E-m:o-p:32:32-f64:32:64-n32"
3target triple = "powerpc-unknown-linux-gnu"
4
5%struct.sm = type { i8, i8 }
6
7; Function Attrs: nounwind ssp
8define void @foo(ptr byval(%struct.sm) %s) #0 {
9entry:
10  %0 = load i8, ptr %s, align 1
11  %conv2 = zext i8 %0 to i32
12  %add = add nuw nsw i32 %conv2, 3
13  %conv1 = trunc i32 %add to i8
14  store i8 %conv1, ptr %s, align 1
15  call void @bar(ptr byval(%struct.sm) %s, ptr byval(%struct.sm) %s) #1
16  ret void
17}
18
19; CHECK-LABEL: @foo
20; CHECK: stb {{r[0-9]+}}, [[OFF:[0-9]+]]({{r[3?1]}})
21; CHECK: lhz r4, [[OFF]]({{r[3?1]}})
22; CHECK: bl bar
23; CHECK: blr
24
25declare void @bar(ptr byval(%struct.sm), ptr byval(%struct.sm))
26
27attributes #0 = { nounwind ssp }
28attributes #1 = { nounwind }
29
30