1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -verify-machineinstrs -mtriple=powerpc \
3; RUN:     -mcpu=pwr9 < %s | FileCheck %s --check-prefix=32BIT
4
5; RUN: llc -verify-machineinstrs -mtriple=powerpc64 \
6; RUN:     -mcpu=pwr9 < %s | FileCheck %s --check-prefix=64BIT
7
8define dso_local void @foo(i32 %inta, i64* %long_intb) {
9  entry:
10    %conv = sext i32 %inta to i64
11    %shl = shl nsw i64 %conv, 8
12    store i64 %shl, i64* %long_intb, align 8
13    ret void
14}
15
16; CHECK-LABEL:   foo:
17
18; 32BIT-DAG:     srawi [[REG1:[0-9]+]], [[REG2:[0-9]+]], 31
19; 32BIT-DAG:     rotlwi [[REG3:[0-9]+]], [[REG2]], 8
20; 32BIT-DAG:     slwi [[REG4:[0-9]+]], [[REG2]], 8
21; 32BIT-DAG:     rlwimi [[REG5:[0-9]+]], [[REG1]], 8, 0, 23
22; 32BIT-DAG:     stw [[REG4]], 4([[REG6:[0-9]+]])
23; 32BIT-DAG:     stw [[REG5]], 0([[REG6]])
24; 32BIT:         blr
25
26; 64BIT:         extswsli [[REG1:[0-9]+]], [[REG2:[0-9]+]], 8
27; 64BIT-NEXT:    std [[REG1]], 0([[REG3:[0-9]+]])
28; 64BIT-NEXT:    blr
29