summaryrefslogtreecommitdiffstats
path: root/test/Sema/builtins.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-04-08 18:45:10 +0000
committerdim <dim@FreeBSD.org>2013-04-08 18:45:10 +0000
commitc72c57c9e9b69944e3e009cd5e209634839581d3 (patch)
tree4fc2f184c499d106f29a386c452b49e5197bf63d /test/Sema/builtins.c
parent5b20025c30d23d521e12c1f33ec8fa6b821952cd (diff)
downloadFreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.zip
FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.tar.gz
Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
Diffstat (limited to 'test/Sema/builtins.c')
-rw-r--r--test/Sema/builtins.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Sema/builtins.c b/test/Sema/builtins.c
index e3b3b7e..d525ac0 100644
--- a/test/Sema/builtins.c
+++ b/test/Sema/builtins.c
@@ -176,3 +176,18 @@ void test17() {
#undef T
#undef F
}
+
+void test18() {
+ char src[1024];
+ char dst[2048];
+ size_t result;
+ void *ptr;
+
+ ptr = __builtin___memccpy_chk(dst, src, '\037', sizeof(src), sizeof(dst));
+ result = __builtin___strlcpy_chk(dst, src, sizeof(src), sizeof(dst));
+ result = __builtin___strlcat_chk(dst, src, sizeof(src), sizeof(dst));
+
+ ptr = __builtin___memccpy_chk(dst, src, '\037', sizeof(src)); // expected-error {{too few arguments to function call}}
+ ptr = __builtin___strlcpy_chk(dst, src, sizeof(src), sizeof(dst)); // expected-warning {{incompatible integer to pointer conversion}}
+ ptr = __builtin___strlcat_chk(dst, src, sizeof(src), sizeof(dst)); // expected-warning {{incompatible integer to pointer conversion}}
+}
OpenPOWER on IntegriCloud