| 1 |
; RUN: llc -verify-machineinstrs -mcpu=ppc64 -ppc-asm-full-reg-names < %s | FileCheck %s |
| 2 |
target datalayout = "E-m:o-p:32:32-f64:32:64-n32" |
| 3 |
target triple = "powerpc-unknown-linux-gnu" |
| 4 |
|
| 5 |
%struct.sm = type { i8, i8 } |
| 6 |
|
| 7 |
; Function Attrs: nounwind ssp |
| 8 |
define void @foo(ptr byval(%struct.sm) %s) #0 { |
| 9 |
entry: |
| 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 |
|
| 25 |
declare void @bar(ptr byval(%struct.sm), ptr byval(%struct.sm)) |
| 26 |
|
| 27 |
attributes #0 = { nounwind ssp } |
| 28 |
attributes #1 = { nounwind } |
| 29 |
|