[cfe-commits] r65115 - in /cfe/trunk: include/clang/AST/Builtins.def test/CodeGen/builtins.c
Daniel Dunbar
daniel at zuster.org
Thu Feb 19 22:36:40 PST 2009
Author: ddunbar
Date: Fri Feb 20 00:36:40 2009
New Revision: 65115
URL: http://llvm.org/viewvc/llvm-project?rev=65115&view=rev
Log:
Add some stdlib builtins
Modified:
cfe/trunk/include/clang/AST/Builtins.def
cfe/trunk/test/CodeGen/builtins.c
Modified: cfe/trunk/include/clang/AST/Builtins.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Builtins.def?rev=65115&r1=65114&r2=65115&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Builtins.def (original)
+++ cfe/trunk/include/clang/AST/Builtins.def Fri Feb 20 00:36:40 2009
@@ -138,6 +138,12 @@
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_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_strrchr, "c*cC*i", "nF")
BUILTIN(__builtin_return_address, "v*Ui", "n")
BUILTIN(__builtin_frame_address, "v*Ui", "n")
BUILTIN(__builtin_flt_rounds, "i", "nc")
Modified: cfe/trunk/test/CodeGen/builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtins.c?rev=65115&r1=65114&r2=65115&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/builtins.c (original)
+++ cfe/trunk/test/CodeGen/builtins.c Fri Feb 20 00:36:40 2009
@@ -77,9 +77,17 @@
Q(powif, (1.2f, N));
Q(powil, (1.2f, N));
- // Object size checking
+ // Lib functions
int a, b, n = random(); // Avoid optimizing out.
char s0[10], s1[] = "Hello";
+ V(strcat, (s0, s1));
+ V(strncat, (s0, s1, n));
+ V(strchr, (s0, s1[0]));
+ V(strrchr, (s0, s1[0]));
+ V(strcpy, (s0, s1));
+ V(strncpy, (s0, s1, n));
+
+ // Object size checking
V(__memset_chk, (s0, 0, sizeof s0, n));
V(__memcpy_chk, (s0, s1, sizeof s0, n));
V(__memmove_chk, (s0, s1, sizeof s0, n));
More information about the cfe-commits
mailing list