1 ; Test that CodeGenPrepare respects endianness when splitting a store.
3 ; RUN: llc -mtriple=s390x-linux-gnu -mcpu=z13 -force-split-store < %s | FileCheck %s
5 define void @fun(i16* %Src, i16* %Dst) {
6 ; CHECK-LABEL: # %bb.0:
7 ; CHECK: lh %r0, 0(%r2)
8 ; CHECK-NEXT: stc %r0, 1(%r3)
9 ; CHECK-NEXT: srl %r0, 8
10 ; CHECK-NEXT: stc %r0, 0(%r3)
12 %1 = load i16, i16* %Src
13 %2 = trunc i16 %1 to i8
15 %4 = trunc i16 %3 to i8
16 %5 = zext i8 %2 to i16
17 %6 = zext i8 %4 to i16
18 %7 = shl nuw i16 %6, 8
20 store i16 %8, i16* %Dst