blob: a43c4eede4521fb5d4a609f492f812c781ae64d8 [file] [log] [blame]
Craig Topper19b4a712011-12-25 15:20:31 +00001// RUN: %clang_cc1 %s -O3 -triple=x86_64-apple-darwin -target-feature +lzcnt -emit-llvm -o - | FileCheck %s
Craig Topper5c752082011-12-25 06:25:37 +00002
3// Don't include mm_malloc.h, it's system specific.
4#define __MM_MALLOC_H
5
6#include <x86intrin.h>
7
8unsigned short test__lzcnt16(unsigned short __X)
9{
Craig Topper19b4a712011-12-25 15:20:31 +000010 // CHECK: @llvm.ctlz.i16
Craig Topper5c752082011-12-25 06:25:37 +000011 return __lzcnt16(__X);
12}
13
14unsigned int test_lzcnt32(unsigned int __X)
15{
Craig Topper19b4a712011-12-25 15:20:31 +000016 // CHECK: @llvm.ctlz.i32
Craig Topper5c752082011-12-25 06:25:37 +000017 return __lzcnt32(__X);
18}
19
20unsigned long long test__lzcnt64(unsigned long long __X)
21{
Craig Topper19b4a712011-12-25 15:20:31 +000022 // CHECK: @llvm.ctlz.i64
Craig Topper5c752082011-12-25 06:25:37 +000023 return __lzcnt64(__X);
24}