Define __builtin_ffs[ll] with a signed argument instead of unsigned.

GCC documents these as unsigned, but defines them as signed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162106 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Basic/Builtins.def b/include/clang/Basic/Builtins.def
index 1b060a5..84b2881 100644
--- a/include/clang/Basic/Builtins.def
+++ b/include/clang/Basic/Builtins.def
@@ -376,9 +376,9 @@
 BUILTIN(__builtin_ctzl , "iULi" , "nc")
 BUILTIN(__builtin_ctzll, "iULLi", "nc")
 // TODO: int ctzimax(uintmax_t)
-BUILTIN(__builtin_ffs  , "iUi"  , "nc")
-BUILTIN(__builtin_ffsl , "iULi" , "nc")
-BUILTIN(__builtin_ffsll, "iULLi", "nc")
+BUILTIN(__builtin_ffs  , "ii"  , "nc")
+BUILTIN(__builtin_ffsl , "iLi" , "nc")
+BUILTIN(__builtin_ffsll, "iLLi", "nc")
 BUILTIN(__builtin_parity  , "iUi"  , "nc")
 BUILTIN(__builtin_parityl , "iULi" , "nc")
 BUILTIN(__builtin_parityll, "iULLi", "nc")
diff --git a/test/Sema/builtins-decl.c b/test/Sema/builtins-decl.c
index 19bdb84..d6b004a 100644
--- a/test/Sema/builtins-decl.c
+++ b/test/Sema/builtins-decl.c
@@ -6,3 +6,8 @@
 extern unsigned int __builtin_ia32_crc32qi (unsigned int, unsigned char);
 extern unsigned int __builtin_ia32_crc32hi (unsigned int, unsigned short);
 extern unsigned int __builtin_ia32_crc32si (unsigned int, unsigned int);
+
+// GCC documents these as unsigned, but they are defined with a signed argument.
+extern int __builtin_ffs(int);
+extern int __builtin_ffsl(long);
+extern int __builtin_ffsll(long long);