blob: a528d728be066500467a97d7c9b0333ce95ba1d0 [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 -mattr=-CIX | \
Reid Spencer43b40032007-04-16 15:31:49 +00008; RUN: not grep -i ctpop
Andrew Lenharth14197112005-05-04 15:20:16 +00009
Tanya Lattner53a66d12008-02-19 01:41:04 +000010declare i64 @llvm.ctpop.i64(i64)
Andrew Lenharth14197112005-05-04 15:20:16 +000011
Tanya Lattner53a66d12008-02-19 01:41:04 +000012define i64 @bar(i64 %x) {
Andrew Lenharth14197112005-05-04 15:20:16 +000013entry:
Tanya Lattner53a66d12008-02-19 01:41:04 +000014 %tmp.1 = call i64 @llvm.ctpop.i64( i64 %x ) ; <i64> [#uses=1]
15 ret i64 %tmp.1
Andrew Lenharth14197112005-05-04 15:20:16 +000016}
Tanya Lattner53a66d12008-02-19 01:41:04 +000017