blob: 654cd04dd4f8d19600034b9921fb29271755ca95 [file] [log] [blame]
Andrew Lenharthe8aebf72005-05-04 15:56:34 +00001; Make sure this testcase codegens to the ctpop instruction
Tanya Lattner53a66d12008-02-19 01:41:04 +00002; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev67 | grep -i ctpop
3; RUN: llvm-as < %s | llc -march=alpha -mattr=+CIX | \
Reid Spencer65f47a32007-04-15 18:40:57 +00004; RUN: grep -i ctpop
Tanya Lattner53a66d12008-02-19 01:41:04 +00005; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev6 | \
Reid Spencer65f47a32007-04-15 18:40:57 +00006; RUN: not grep -i ctpop
Tanya Lattner53a66d12008-02-19 01:41:04 +00007; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev56 | \
Reid Spencer65f47a32007-04-15 18:40:57 +00008; RUN: not grep -i ctpop
Tanya Lattner53a66d12008-02-19 01:41:04 +00009; RUN: llvm-as < %s | llc -march=alpha -mattr=-CIX | \
Reid Spencer43b40032007-04-16 15:31:49 +000010; RUN: not grep -i ctpop
Andrew Lenharth14197112005-05-04 15:20:16 +000011
Tanya Lattner53a66d12008-02-19 01:41:04 +000012declare i64 @llvm.ctpop.i64(i64)
Andrew Lenharth14197112005-05-04 15:20:16 +000013
Tanya Lattner53a66d12008-02-19 01:41:04 +000014define i64 @bar(i64 %x) {
Andrew Lenharth14197112005-05-04 15:20:16 +000015entry:
Tanya Lattner53a66d12008-02-19 01:41:04 +000016 %tmp.1 = call i64 @llvm.ctpop.i64( i64 %x ) ; <i64> [#uses=1]
17 ret i64 %tmp.1
Andrew Lenharth14197112005-05-04 15:20:16 +000018}
Tanya Lattner53a66d12008-02-19 01:41:04 +000019