1 ; Make sure this testcase is supported by all code generators 2 ; RUN: llc < %s 3 4 declare i64 @llvm.ctpop.i64(i64) 5 6 declare i32 @llvm.ctpop.i32(i32) 7 8 declare i16 @llvm.ctpop.i16(i16) 9 10 declare i8 @llvm.ctpop.i8(i8) 11 12 define 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 24 declare i64 @llvm.ctlz.i64(i64) 25 26 declare i32 @llvm.ctlz.i32(i32) 27 28 declare i16 @llvm.ctlz.i16(i16) 29 30 declare i8 @llvm.ctlz.i8(i8) 31 32 define 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 ) ; <i8> [#uses=1] 34 %b = call i16 @llvm.ctlz.i16( i16 %B ) ; <i16> [#uses=1] 35 %c = call i32 @llvm.ctlz.i32( i32 %C ) ; <i32> [#uses=1] 36 %d = call i64 @llvm.ctlz.i64( i64 %D ) ; <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 44 declare i64 @llvm.cttz.i64(i64) 45 46 declare i32 @llvm.cttz.i32(i32) 47 48 declare i16 @llvm.cttz.i16(i16) 49 50 declare i8 @llvm.cttz.i8(i8) 51 52 define 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 ) ; <i8> [#uses=1] 54 %b = call i16 @llvm.cttz.i16( i16 %B ) ; <i16> [#uses=1] 55 %c = call i32 @llvm.cttz.i32( i32 %C ) ; <i32> [#uses=1] 56 %d = call i64 @llvm.cttz.i64( i64 %D ) ; <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