2006-01-14 02:25:24 +01:00
|
|
|
; bswap should be constant folded when it is passed a constant argument
|
|
|
|
|
2009-09-11 20:01:28 +02:00
|
|
|
; RUN: opt < %s -constprop -S | not grep call
|
2006-01-14 02:25:24 +01:00
|
|
|
|
2008-03-01 10:15:35 +01:00
|
|
|
declare i16 @llvm.bswap.i16(i16)
|
2006-01-14 02:25:24 +01:00
|
|
|
|
2008-03-01 10:15:35 +01:00
|
|
|
declare i32 @llvm.bswap.i32(i32)
|
|
|
|
|
|
|
|
declare i64 @llvm.bswap.i64(i64)
|
|
|
|
|
|
|
|
define i16 @W() {
|
|
|
|
%Z = call i16 @llvm.bswap.i16( i16 1 ) ; <i16> [#uses=1]
|
|
|
|
ret i16 %Z
|
2006-01-14 02:25:24 +01:00
|
|
|
}
|
|
|
|
|
2008-03-01 10:15:35 +01:00
|
|
|
define i32 @X() {
|
|
|
|
%Z = call i32 @llvm.bswap.i32( i32 1 ) ; <i32> [#uses=1]
|
|
|
|
ret i32 %Z
|
2006-01-14 02:25:24 +01:00
|
|
|
}
|
|
|
|
|
2008-03-01 10:15:35 +01:00
|
|
|
define i64 @Y() {
|
|
|
|
%Z = call i64 @llvm.bswap.i64( i64 1 ) ; <i64> [#uses=1]
|
|
|
|
ret i64 %Z
|
2006-01-14 02:25:24 +01:00
|
|
|
}
|
2008-03-01 10:15:35 +01:00
|
|
|
|