Add intrinsics for lzcnt and tzcnt instructions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147263 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/lzcnt-builtins.c b/test/CodeGen/lzcnt-builtins.c
new file mode 100644
index 0000000..7b4da90
--- /dev/null
+++ b/test/CodeGen/lzcnt-builtins.c
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 %s -O3 -triple=x86_64-apple-darwin -target-feature +lzcnt -S -o - | FileCheck %s
+
+// Don't include mm_malloc.h, it's system specific.
+#define __MM_MALLOC_H
+
+#include <x86intrin.h>
+
+unsigned short test__lzcnt16(unsigned short __X)
+{
+  // CHECK: lzcntw
+  return __lzcnt16(__X);
+}
+
+unsigned int test_lzcnt32(unsigned int __X)
+{
+  // CHECK: lzcntl
+  return __lzcnt32(__X);
+}
+
+unsigned long long test__lzcnt64(unsigned long long __X)
+{
+  // CHECK: lzcntq
+  return __lzcnt64(__X);
+}