summaryrefslogtreecommitdiffstats
path: root/test/Analysis/bstring.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/bstring.c')
-rw-r--r--test/Analysis/bstring.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/test/Analysis/bstring.c b/test/Analysis/bstring.c
index e8c3021f27..f472a3e011 100644
--- a/test/Analysis/bstring.c
+++ b/test/Analysis/bstring.c
@@ -72,7 +72,10 @@ void memcpy2 () {
char src[] = {1, 2, 3, 4};
char dst[1];
- memcpy(dst, src, 4); // expected-warning{{Memory copy function overflows destination buffer}}
+ memcpy(dst, src, 4); // expected-warning{{Memory copy function overflows destination buffer}}
+#ifndef VARIANT
+ // expected-warning@-2{{memcpy' will always overflow; destination buffer has size 1, but size argument is 4}}
+#endif
}
void memcpy3 () {
@@ -94,6 +97,9 @@ void memcpy5() {
char dst[3];
memcpy(dst+2, src+2, 2); // expected-warning{{Memory copy function overflows destination buffer}}
+#ifndef VARIANT
+ // expected-warning@-2{{memcpy' will always overflow; destination buffer has size 1, but size argument is 2}}
+#endif
}
void memcpy6() {
@@ -351,7 +357,10 @@ void memmove2 () {
char src[] = {1, 2, 3, 4};
char dst[1];
- memmove(dst, src, 4); // expected-warning{{overflow}}
+ memmove(dst, src, 4); // expected-warning{{Memory copy function overflows destination buffer}}
+#ifndef VARIANT
+ // expected-warning@-2{{memmove' will always overflow; destination buffer has size 1, but size argument is 4}}
+#endif
}
//===----------------------------------------------------------------------===
@@ -361,8 +370,7 @@ void memmove2 () {
#ifdef VARIANT
#define bcmp BUILTIN(bcmp)
-// __builtin_bcmp is not defined with const in Builtins.def.
-int bcmp(/*const*/ void *s1, /*const*/ void *s2, size_t n);
+int bcmp(const void *s1, const void *s2, size_t n);
#define memcmp bcmp
//
#else /* VARIANT */