Add more builtin definitions, including strcmp.

- PR3964.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68710 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2009-04-09 16:42:50 +00:00
Родитель 044b6f0417
Коммит 7a0048b3f5
2 изменённых файлов: 24 добавлений и 6 удалений

Просмотреть файл

@ -134,16 +134,33 @@ BUILTIN(__builtin_va_start, "vA.", "n")
BUILTIN(__builtin_va_end, "vA", "n")
BUILTIN(__builtin_va_copy, "vAA", "n")
BUILTIN(__builtin_stdarg_start, "vA.", "n")
BUILTIN(__builtin_bcmp, "iv*v*z", "n")
BUILTIN(__builtin_bcopy, "vv*v*z", "n")
BUILTIN(__builtin_bzero, "vv*z", "n")
BUILTIN(__builtin_memcpy, "v*v*vC*z", "n")
BUILTIN(__builtin_memmove, "v*v*vC*z", "n")
BUILTIN(__builtin_memset, "v*v*iz", "n")
BUILTIN(__builtin_memcmp, "ivC*vC*z", "nF")
BUILTIN(__builtin_memcpy, "v*v*vC*z", "nF")
BUILTIN(__builtin_memmove, "v*v*vC*z", "nF")
BUILTIN(__builtin_mempcpy, "v*v*vC*z", "nF")
BUILTIN(__builtin_memset, "v*v*iz", "nF")
BUILTIN(__builtin_stpcpy, "c*c*cC*", "nF")
BUILTIN(__builtin_stpncpy, "c*c*cC*z", "nF")
BUILTIN(__builtin_strcasecmp, "icC*cC*", "nF")
BUILTIN(__builtin_strcat, "c*c*cC*", "nF")
BUILTIN(__builtin_strncat, "c*c*cC*z", "nF")
BUILTIN(__builtin_strcpy, "c*c*cC*", "nF")
BUILTIN(__builtin_strncpy, "c*c*cC*z", "nF")
BUILTIN(__builtin_strchr, "c*cC*i", "nF")
BUILTIN(__builtin_strcmp, "icC*cC*", "nF")
BUILTIN(__builtin_strcpy, "c*c*cC*", "nF")
BUILTIN(__builtin_strcspn, "zcC*cC*", "nF")
BUILTIN(__builtin_strdup, "c*cC*", "nF")
BUILTIN(__builtin_strlen, "zcC*", "nF")
BUILTIN(__builtin_strncasecmp, "icC*cC*z", "nF")
BUILTIN(__builtin_strncat, "c*c*cC*z", "nF")
BUILTIN(__builtin_strncmp, "icC*cC*z", "nF")
BUILTIN(__builtin_strncpy, "c*c*cC*z", "nF")
BUILTIN(__builtin_strndup, "c*cC*z", "nF")
BUILTIN(__builtin_strpbrk, "c*cC*cC*", "nF")
BUILTIN(__builtin_strrchr, "c*cC*i", "nF")
BUILTIN(__builtin_strspn, "zcC*cC*", "nF")
BUILTIN(__builtin_strstr, "c*cC*cC*", "nF")
BUILTIN(__builtin_return_address, "v*Ui", "n")
BUILTIN(__builtin_frame_address, "v*Ui", "n")
BUILTIN(__builtin_flt_rounds, "i", "nc")

Просмотреть файл

@ -81,6 +81,7 @@ int main() {
int a, b, n = random(); // Avoid optimizing out.
char s0[10], s1[] = "Hello";
V(strcat, (s0, s1));
V(strcmp, (s0, s1));
V(strncat, (s0, s1, n));
V(strchr, (s0, s1[0]));
V(strrchr, (s0, s1[0]));