1
0
mirror of https://github.com/c64scene-ar/llvm-6502.git synced 2024-12-26 21:32:10 +00:00
llvm-6502/test/CodeGen/X86/bswap.ll
Tanya Lattner 33eefffb2b Remove llvm-upgrade and update tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47432 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21 07:42:26 +00:00

28 lines
667 B
LLVM

; bswap should be constant folded when it is passed a constant argument
; RUN: llvm-as < %s | llc -march=x86 | \
; RUN: grep bswapl | count 3
; RUN: llvm-as < %s | llc -march=x86 | grep rolw | count 1
declare i16 @llvm.bswap.i16(i16)
declare i32 @llvm.bswap.i32(i32)
declare i64 @llvm.bswap.i64(i64)
define i16 @W(i16 %A) {
%Z = call i16 @llvm.bswap.i16( i16 %A ) ; <i16> [#uses=1]
ret i16 %Z
}
define i32 @X(i32 %A) {
%Z = call i32 @llvm.bswap.i32( i32 %A ) ; <i32> [#uses=1]
ret i32 %Z
}
define i64 @Y(i64 %A) {
%Z = call i64 @llvm.bswap.i64( i64 %A ) ; <i64> [#uses=1]
ret i64 %Z
}