1 ; bswap should be constant folded when it is passed a constant argument
3 ; RUN: opt < %s -constprop -S | FileCheck %s
5 declare i16 @llvm.bswap.i16(i16)
7 declare i32 @llvm.bswap.i32(i32)
9 declare i64 @llvm.bswap.i64(i64)
11 declare i80 @llvm.bswap.i80(i80)
13 ; CHECK-LABEL: define i16 @W(
16 %Z = call i16 @llvm.bswap.i16( i16 1 ) ; <i16> [#uses=1]
20 ; CHECK-LABEL: define i32 @X(
22 ; CHECK: ret i32 16777216
23 %Z = call i32 @llvm.bswap.i32( i32 1 ) ; <i32> [#uses=1]
27 ; CHECK-LABEL: define i64 @Y(
29 ; CHECK: ret i64 72057594037927936
30 %Z = call i64 @llvm.bswap.i64( i64 1 ) ; <i64> [#uses=1]
34 ; CHECK-LABEL: define i80 @Z(
36 ; CHECK: ret i80 -450681596205739728166896
37 ; 0xA0908070605040302010
38 %Z = call i80 @llvm.bswap.i80( i80 76151636403560493650080 )
39 ; 0x102030405060708090A0