From: Jordy Rose Date: Tue, 28 Jun 2011 05:34:40 +0000 (+0000) Subject: [analyzer] strnlen isn't a builtin, don't test for it X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0fa6bf7f021880e625dab018a25877fb0164d038;p=clang [analyzer] strnlen isn't a builtin, don't test for it git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133994 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/string.c b/test/Analysis/string.c index 250989fba6..dc97e1a119 100644 --- a/test/Analysis/string.c +++ b/test/Analysis/string.c @@ -143,24 +143,23 @@ void strlen_liveness(const char *x) { // strnlen() //===----------------------------------------------------------------------=== -#define strnlen BUILTIN(strnlen) size_t strnlen(const char *s, size_t maxlen); void strnlen_constant0() { if (strnlen("123", 10) != 3) - (void)*(char*)0; // no-warning + (void)*(char*)0; // expected-warning{{never executed}} } void strnlen_constant1() { const char *a = "123"; if (strnlen(a, 10) != 3) - (void)*(char*)0; // no-warning + (void)*(char*)0; // expected-warning{{never executed}} } void strnlen_constant2(char x) { char a[] = "123"; if (strnlen(a, 10) != 3) - (void)*(char*)0; // no-warning + (void)*(char*)0; // expected-warning{{never executed}} a[0] = x; if (strnlen(a, 10) != 3) (void)*(char*)0; // expected-warning{{null}} @@ -168,19 +167,19 @@ void strnlen_constant2(char x) { void strnlen_constant4() { if (strnlen("123456", 3) != 3) - (void)*(char*)0; // no-warning + (void)*(char*)0; // expected-warning{{never executed}} } void strnlen_constant5() { const char *a = "123456"; if (strnlen(a, 3) != 3) - (void)*(char*)0; // no-warning + (void)*(char*)0; // expected-warning{{never executed}} } void strnlen_constant6(char x) { char a[] = "123456"; if (strnlen(a, 3) != 3) - (void)*(char*)0; // no-warning + (void)*(char*)0; // expected-warning{{never executed}} a[0] = x; if (strnlen(a, 3) != 3) (void)*(char*)0; // expected-warning{{null}} @@ -201,7 +200,7 @@ label: void strnlen_zero() { if (strnlen("abc", 0) != 0) - (void)*(char*)0; // no-warning + (void)*(char*)0; // expected-warning{{never executed}} if (strnlen(NULL, 0) != 0) // no-warning (void)*(char*)0; // no-warning }