1 ; RUN: llc -mtriple=arm-darwin -mattr=v6 < %s | FileCheck %s
2 ; RUN: llc -mtriple=thumb-darwin -mattr=v6 < %s | FileCheck %s
5 define void @test1(i16* nocapture %data) {
7 %0 = load i16, i16* %data, align 2
8 %1 = tail call i16 @llvm.bswap.i16(i16 %0)
9 store i16 %1, i16* %data, align 2
13 ; CHECK: ldrh r[[R1:[0-9]+]], [r0]
14 ; CHECK: rev16 r[[R1]], r[[R1]]
15 ; CHECK: strh r[[R1]], [r0]
19 define void @test2(i16* nocapture %data, i16 zeroext %in) {
21 %0 = tail call i16 @llvm.bswap.i16(i16 %in)
22 store i16 %0, i16* %data, align 2
26 ; CHECK: rev16 r[[R1:[0-9]+]], r1
27 ; CHECK: strh r[[R1]], [r0]
31 define i16 @test3(i16* nocapture %data) {
33 %0 = load i16, i16* %data, align 2
34 %1 = tail call i16 @llvm.bswap.i16(i16 %0)
38 ; CHECK: ldrh r[[R0:[0-9]+]], [r0]
39 ; CHECK: rev16 r[[R0]], r0
42 declare i16 @llvm.bswap.i16(i16)