blob: 7f28a56e9e8e727fea56949373fd75036bebb17a [file] [log] [blame]
Ehsan Amiria538b0f2016-08-03 18:17:35 +00001; RUN: llc -verify-machineinstrs -mcpu=ppc64 < %s | FileCheck %s
Hal Finkel41a55ad2014-08-16 00:17:05 +00002target datalayout = "E-m:o-p:32:32-f64:32:64-n32"
3target triple = "powerpc-apple-macosx10.5.0"
4
5%struct.sm = type { i8, i8 }
6
7; Function Attrs: nounwind ssp
8define void @foo(%struct.sm* byval %s) #0 {
9entry:
David Blaikie79e6c742015-02-27 19:29:02 +000010 %a = getelementptr inbounds %struct.sm, %struct.sm* %s, i32 0, i32 0
David Blaikiea79ac142015-02-27 21:17:42 +000011 %0 = load i8, i8* %a, align 1
Hal Finkel41a55ad2014-08-16 00:17:05 +000012 %conv2 = zext i8 %0 to i32
13 %add = add nuw nsw i32 %conv2, 3
14 %conv1 = trunc i32 %add to i8
15 store i8 %conv1, i8* %a, align 1
16 call void @bar(%struct.sm* byval %s, %struct.sm* byval %s) #1
17 ret void
18}
19
20; CHECK-LABEL: @foo
21; CHECK: stb {{r[0-9]+}}, [[OFF:[0-9]+]]({{r[3]?1}})
22; CHECK: lhz r3, [[OFF]]({{r[3]?1}})
23; CHECK: bl _bar
24; CHECK: blr
25
26declare void @bar(%struct.sm* byval, %struct.sm* byval)
27
28attributes #0 = { nounwind ssp }
29attributes #1 = { nounwind }
30