aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/PowerPC/pr32063.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/PowerPC/pr32063.ll')
-rw-r--r--test/CodeGen/PowerPC/pr32063.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/pr32063.ll b/test/CodeGen/PowerPC/pr32063.ll
new file mode 100644
index 000000000000..f031ec83c55e
--- /dev/null
+++ b/test/CodeGen/PowerPC/pr32063.ll
@@ -0,0 +1,16 @@
+; RUN: llc -O2 < %s | FileCheck %s
+target triple = "powerpc64le-linux-gnu"
+
+define void @foo(i32 %v, i16* %p) {
+ %1 = and i32 %v, -65536
+ %2 = tail call i32 @llvm.bswap.i32(i32 %1)
+ %conv = trunc i32 %2 to i16
+ store i16 %conv, i16* %p
+ ret void
+
+; CHECK: srwi
+; CHECK: sthbrx
+; CHECK-NOT: stwbrx
+}
+
+declare i32 @llvm.bswap.i32(i32)