llvm-mirror/test/CodeGen/ARM/bswap16.ll
David Blaikie ab043ff680 [opaque pointer type] Add textual IR support for explicit type parameter to load instruction
Essentially the same as the GEP change in r230786.

A similar migration script can be used to update test cases, though a few more
test case improvements/changes were required this time around: (r229269-r229278)

import fileinput
import sys
import re

pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)")

for line in sys.stdin:
  sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line))

Reviewers: rafael, dexonsmith, grosser

Differential Revision: http://reviews.llvm.org/D7649

llvm-svn: 230794
2015-02-27 21:17:42 +00:00

43 lines
963 B
LLVM

; RUN: llc -mtriple=arm-darwin -mattr=v6 < %s | FileCheck %s
; RUN: llc -mtriple=thumb-darwin -mattr=v6 < %s | FileCheck %s
define void @test1(i16* nocapture %data) {
entry:
%0 = load i16, i16* %data, align 2
%1 = tail call i16 @llvm.bswap.i16(i16 %0)
store i16 %1, i16* %data, align 2
ret void
; CHECK-LABEL: test1:
; CHECK: ldrh r[[R1:[0-9]+]], [r0]
; CHECK: rev16 r[[R1]], r[[R1]]
; CHECK: strh r[[R1]], [r0]
}
define void @test2(i16* nocapture %data, i16 zeroext %in) {
entry:
%0 = tail call i16 @llvm.bswap.i16(i16 %in)
store i16 %0, i16* %data, align 2
ret void
; CHECK-LABEL: test2:
; CHECK: rev16 r[[R1:[0-9]+]], r1
; CHECK: strh r[[R1]], [r0]
}
define i16 @test3(i16* nocapture %data) {
entry:
%0 = load i16, i16* %data, align 2
%1 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %1
; CHECK-LABEL: test3:
; CHECK: ldrh r[[R0:[0-9]+]], [r0]
; CHECK: rev16 r[[R0]], r0
}
declare i16 @llvm.bswap.i16(i16)