Skip to content
Snippets Groups Projects
Commit 8bfb700a authored by Bill Wendling's avatar Bill Wendling
Browse files

Add tests to check recent changes to some builtins.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170458 91177308-0d34-0410-b5e6-96231b3b80d8
parent 1321eb59
No related branches found
No related tags found
No related merge requests found
......@@ -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}}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment