1; Make sure this testcase is supported by all code generators 2; RUN: llc < %s 3 4declare i64 @llvm.ctpop.i64(i64) 5 6declare i32 @llvm.ctpop.i32(i32) 7 8declare i16 @llvm.ctpop.i16(i16) 9 10declare i8 @llvm.ctpop.i8(i8) 11 12define void @ctpoptest(i8 %A, i16 %B, i32 %C, i64 %D, i8* %AP, i16* %BP, i32* %CP, i64* %DP) { 13 %a = call i8 @llvm.ctpop.i8( i8 %A ) ; <i8> [#uses=1] 14 %b = call i16 @llvm.ctpop.i16( i16 %B ) ; <i16> [#uses=1] 15 %c = call i32 @llvm.ctpop.i32( i32 %C ) ; <i32> [#uses=1] 16 %d = call i64 @llvm.ctpop.i64( i64 %D ) ; <i64> [#uses=1] 17 store i8 %a, i8* %AP 18 store i16 %b, i16* %BP 19 store i32 %c, i32* %CP 20 store i64 %d, i64* %DP 21 ret void 22} 23 24declare i64 @llvm.ctlz.i64(i64, i1) 25 26declare i32 @llvm.ctlz.i32(i32, i1) 27 28declare i16 @llvm.ctlz.i16(i16, i1) 29 30declare i8 @llvm.ctlz.i8(i8, i1) 31 32define void @ctlztest(i8 %A, i16 %B, i32 %C, i64 %D, i8* %AP, i16* %BP, i32* %CP, i64* %DP) { 33 %a = call i8 @llvm.ctlz.i8( i8 %A, i1 true ) ; <i8> [#uses=1] 34 %b = call i16 @llvm.ctlz.i16( i16 %B, i1 true ) ; <i16> [#uses=1] 35 %c = call i32 @llvm.ctlz.i32( i32 %C, i1 true ) ; <i32> [#uses=1] 36 %d = call i64 @llvm.ctlz.i64( i64 %D, i1 true ) ; <i64> [#uses=1] 37 store i8 %a, i8* %AP 38 store i16 %b, i16* %BP 39 store i32 %c, i32* %CP 40 store i64 %d, i64* %DP 41 ret void 42} 43 44declare i64 @llvm.cttz.i64(i64, i1) 45 46declare i32 @llvm.cttz.i32(i32, i1) 47 48declare i16 @llvm.cttz.i16(i16, i1) 49 50declare i8 @llvm.cttz.i8(i8, i1) 51 52define void @cttztest(i8 %A, i16 %B, i32 %C, i64 %D, i8* %AP, i16* %BP, i32* %CP, i64* %DP) { 53 %a = call i8 @llvm.cttz.i8( i8 %A, i1 true ) ; <i8> [#uses=1] 54 %b = call i16 @llvm.cttz.i16( i16 %B, i1 true ) ; <i16> [#uses=1] 55 %c = call i32 @llvm.cttz.i32( i32 %C, i1 true ) ; <i32> [#uses=1] 56 %d = call i64 @llvm.cttz.i64( i64 %D, i1 true ) ; <i64> [#uses=1] 57 store i8 %a, i8* %AP 58 store i16 %b, i16* %BP 59 store i32 %c, i32* %CP 60 store i64 %d, i64* %DP 61 ret void 62} 63