1; Test byteswaps between registers.
2;
3; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
4
5declare i32 @llvm.bswap.i32(i32 %a)
6declare i64 @llvm.bswap.i64(i64 %a)
7
8; Check 32-bit register-to-register byteswaps.
9define i32 @f1(i32 %a) {
10; CHECK-LABEL: f1:
11; CHECK: lrvr [[REGISTER:%r[0-5]]], %r2
12; CHECK: br %r14
13  %swapped = call i32 @llvm.bswap.i32(i32 %a)
14  ret i32 %swapped
15}
16
17; Check 64-bit register-to-register byteswaps.
18define i64 @f2(i64 %a) {
19; CHECK-LABEL: f2:
20; CHECK: lrvgr %r2, %r2
21; CHECK: br %r14
22  %swapped = call i64 @llvm.bswap.i64(i64 %a)
23  ret i64 %swapped
24}
25