aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordy Rose <jediknil@belkadan.com>2011-06-28 05:34:40 +0000
committerJordy Rose <jediknil@belkadan.com>2011-06-28 05:34:40 +0000
commit0fa6bf7f021880e625dab018a25877fb0164d038 (patch)
tree90204b5a3cc71546341c8bba90d1bb2da9af8df9
parent83068315f7d9ed7b82ec35c2c26702151d186a70 (diff)
[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
-rw-r--r--test/Analysis/string.c15
1 files changed, 7 insertions, 8 deletions
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
}