• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -target-feature +lzcnt -emit-llvm -o - | FileCheck %s
2 
3 // Don't include mm_malloc.h, it's system specific.
4 #define __MM_MALLOC_H
5 
6 #include <x86intrin.h>
7 
test__lzcnt16(unsigned short __X)8 unsigned short test__lzcnt16(unsigned short __X)
9 {
10   // CHECK: @llvm.ctlz.i16
11   return __lzcnt16(__X);
12 }
13 
test_lzcnt32(unsigned int __X)14 unsigned int test_lzcnt32(unsigned int __X)
15 {
16   // CHECK: @llvm.ctlz.i32
17   return __lzcnt32(__X);
18 }
19 
test__lzcnt64(unsigned long long __X)20 unsigned long long test__lzcnt64(unsigned long long __X)
21 {
22   // CHECK: @llvm.ctlz.i64
23   return __lzcnt64(__X);
24 }
25 
test_lzcnt_u32(unsigned int __X)26 unsigned int test_lzcnt_u32(unsigned int __X)
27 {
28   // CHECK: @llvm.ctlz.i32
29   return _lzcnt_u32(__X);
30 }
31 
test__lzcnt_u64(unsigned long long __X)32 unsigned long long test__lzcnt_u64(unsigned long long __X)
33 {
34   // CHECK: @llvm.ctlz.i64
35   return _lzcnt_u64(__X);
36 }
37