Ehsan Amiri | a538b0f | 2016-08-03 18:17:35 +0000 | [diff] [blame] | 1 | ; RUN: llc -verify-machineinstrs -mcpu=ppc64 < %s | FileCheck %s |
Hal Finkel | 41a55ad | 2014-08-16 00:17:05 +0000 | [diff] [blame] | 2 | target datalayout = "E-m:o-p:32:32-f64:32:64-n32" |
| 3 | target triple = "powerpc-apple-macosx10.5.0" |
| 4 | |
| 5 | %struct.sm = type { i8, i8 } |
| 6 | |
| 7 | ; Function Attrs: nounwind ssp |
| 8 | define void @foo(%struct.sm* byval %s) #0 { |
| 9 | entry: |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 10 | %a = getelementptr inbounds %struct.sm, %struct.sm* %s, i32 0, i32 0 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 11 | %0 = load i8, i8* %a, align 1 |
Hal Finkel | 41a55ad | 2014-08-16 00:17:05 +0000 | [diff] [blame] | 12 | %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 | |
| 26 | declare void @bar(%struct.sm* byval, %struct.sm* byval) |
| 27 | |
| 28 | attributes #0 = { nounwind ssp } |
| 29 | attributes #1 = { nounwind } |
| 30 | |