1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=arm-darwin -mattr=v6 | FileCheck %s --check-prefixes=CHECK,ARM
3 ; RUN: llc < %s -mtriple=thumb-darwin -mattr=v6 | FileCheck %s --check-prefixes=CHECK,THUMB
5 define void @test1(i16* nocapture %data) {
7 ; CHECK: @ %bb.0: @ %entry
8 ; CHECK-NEXT: ldrh r1, [r0]
9 ; CHECK-NEXT: rev16 r1, r1
10 ; CHECK-NEXT: strh r1, [r0]
13 %0 = load i16, i16* %data, align 2
14 %1 = tail call i16 @llvm.bswap.i16(i16 %0)
15 store i16 %1, i16* %data, align 2
19 define void @test2(i16* nocapture %data, i16 zeroext %in) {
21 ; CHECK: @ %bb.0: @ %entry
22 ; CHECK-NEXT: rev16 r1, r1
23 ; CHECK-NEXT: strh r1, [r0]
26 %0 = tail call i16 @llvm.bswap.i16(i16 %in)
27 store i16 %0, i16* %data, align 2
31 define i16 @test3(i16* nocapture %data) {
33 ; CHECK: @ %bb.0: @ %entry
34 ; CHECK-NEXT: ldrh r0, [r0]
35 ; CHECK-NEXT: rev16 r0, r0
38 %0 = load i16, i16* %data, align 2
39 %1 = tail call i16 @llvm.bswap.i16(i16 %0)
43 declare i16 @llvm.bswap.i16(i16)