diff options
author | Martin Sebor <msebor@gcc.gnu.org> | 2017-05-05 12:03:26 -0600 |
---|---|---|
committer | Martin Sebor <msebor@gcc.gnu.org> | 2017-05-05 12:03:26 -0600 |
commit | 13c5654f74df6d5c20802122e45befcc3e4da9ed (patch) | |
tree | 990df7a91cbd9392335ab72a333c471f8f2600e3 /gcc/testsuite/gcc.dg | |
parent | 2d66253dd8845276b8c91eb1624b52ebcf6c554b (diff) | |
download | gcc-13c5654f74df6d5c20802122e45befcc3e4da9ed.zip gcc-13c5654f74df6d5c20802122e45befcc3e4da9ed.tar.gz gcc-13c5654f74df6d5c20802122e45befcc3e4da9ed.tar.bz2 |
builtins.c (check_sizes, [...]): Fix typos introduced during merge conflict resolution.
gcc/ChangeLog:
* builtins.c (check_sizes, check_strncat_sizes): Fix typos
introduced during merge conflict resolution.
(expand_builtin_strncat): Same.
gcc/testsuite/ChangeLog:
* gcc.dg/pr78138.c: Adjust text of expected diagnostics.
* gcc.dg/pr79214.c: Same.
* gcc.dg/pr79222.c: Same.
* gcc.dg/pr79223.c: Same.
* gcc.dg/tree-ssa/builtins-folding-gimple-ub.c: Expect warnings.
From-SVN: r247652
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr78138.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr79214.c | 22 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr79222.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr79223.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/builtins-folding-gimple-ub.c | 11 |
5 files changed, 25 insertions, 18 deletions
diff --git a/gcc/testsuite/gcc.dg/pr78138.c b/gcc/testsuite/gcc.dg/pr78138.c index c0c861e..cda2fb8 100644 --- a/gcc/testsuite/gcc.dg/pr78138.c +++ b/gcc/testsuite/gcc.dg/pr78138.c @@ -12,7 +12,7 @@ extern char* strcpy (char*, const char*); void f (int i, int j) { - strcpy (d, j ? "12345" : "123456"); /* { dg-warning ".strcpy.: writing between 6 and 7 bytes into a region of size 5 " } */ + strcpy (d, j ? "12345" : "123456"); /* { dg-warning ".strcpy. writing between 6 and 7 bytes into a region of size 5 " } */ } void g (void *p) diff --git a/gcc/testsuite/gcc.dg/pr79214.c b/gcc/testsuite/gcc.dg/pr79214.c index fbdecf4..79d2a25 100644 --- a/gcc/testsuite/gcc.dg/pr79214.c +++ b/gcc/testsuite/gcc.dg/pr79214.c @@ -22,67 +22,67 @@ size_t range (void) void test_bzero (void) { - bzero (d, range ()); /* { dg-warning ".__builtin_bzero. writing between 4 and \[0-9\]+ bytes into a region of size 3 overflows the destination" } */ + bzero (d, range ()); /* { dg-warning ".__builtin_bzero. writing 4 or more bytes into a region of size 3 overflows the destination" } */ } void test_memcpy (void) { - memcpy (d, s, range ()); /* { dg-warning ".__builtin_memcpy. writing between 4 and \[0-9\]+ bytes into a region of size 3 overflows the destination" } */ + memcpy (d, s, range ()); /* { dg-warning ".__builtin_memcpy. writing 4 or more bytes into a region of size 3 overflows the destination" } */ } void test_memmove (void) { - memmove (d, d + 1, range ()); /* { dg-warning ".__builtin_memmove. writing between 4 and \[0-9\]+ bytes into a region of size 3 overflows the destination" } */ + memmove (d, d + 1, range ()); /* { dg-warning ".__builtin_memmove. writing 4 or more bytes into a region of size 3 overflows the destination" } */ } void test_mempcpy (void) { - mempcpy (d, s, range ()); /* { dg-warning ".__builtin_mempcpy. writing between 4 and \[0-9\]+ bytes into a region of size 3 overflows the destination" } */ + mempcpy (d, s, range ()); /* { dg-warning ".__builtin_mempcpy. writing 4 or more bytes into a region of size 3 overflows the destination" } */ } void test_memset (int n) { - memset (d, n, range ()); /* { dg-warning ".__builtin_memset. writing between 4 and \[0-9\]+ bytes into a region of size 3 overflows the destination" } */ + memset (d, n, range ()); /* { dg-warning ".__builtin_memset. writing 4 or more bytes into a region of size 3 overflows the destination" } */ } void test_strcat (int i) { const char *s = i < 0 ? "123" : "4567"; - strcat (d, s); /* { dg-warning ".__builtin_strcat. writing 4 bytes into a region of size 3 overflows the destination" } */ + strcat (d, s); /* { dg-warning ".__builtin_strcat. writing between 4 and 5 bytes into a region of size 3 overflows the destination" } */ } char* test_stpcpy (int i) { const char *s = i < 0 ? "123" : "4567"; - return stpcpy (d, s); /* { dg-warning ".__builtin_stpcpy. writing 4 bytes into a region of size 3 overflows the destination" } */ + return stpcpy (d, s); /* { dg-warning ".__builtin_stpcpy. writing between 4 and 5 bytes into a region of size 3 overflows the destination" } */ } char* test_stpncpy (int i) { const char *s = i < 0 ? "123" : "4567"; - return stpncpy (d, s, range ()); /* { dg-warning ".__builtin_stpncpy. writing between 4 and \[0-9\]+ bytes into a region of size 3 overflows the destination" } */ + return stpncpy (d, s, range ()); /* { dg-warning ".__builtin_stpncpy. writing 4 or more bytes into a region of size 3 overflows the destination" } */ } char* test_strcpy (int i) { const char *s = i < 0 ? "123" : "4567"; - return strcpy (d, s); /* { dg-warning ".__builtin_strcpy. writing 4 bytes into a region of size 3 overflows the destination" } */ + return strcpy (d, s); /* { dg-warning ".__builtin_strcpy. writing between 4 and 5 bytes into a region of size 3 overflows the destination" } */ } char* test_strncpy (int i) { const char *s = i < 0 ? "123" : "4567"; - return strncpy (d, s, range ()); /* { dg-warning ".__builtin_strncpy. writing between 4 and \[0-9\]+ bytes into a region of size 3 overflows the destination" } */ + return strncpy (d, s, range ()); /* { dg-warning ".__builtin_strncpy. writing 4 or more bytes into a region of size 3 overflows the destination" } */ } char* test_strncat (int i) { const char *s = i < 0 ? "123" : "4567"; - return strncat (d, s, range ()); /* { dg-warning ".__builtin_strncat.: specified bound between 4 and \[0-9\]+" } */ + return strncat (d, s, range ()); /* { dg-warning ".__builtin_strncat. specified bound between 4 and \[0-9\]+" } */ } diff --git a/gcc/testsuite/gcc.dg/pr79222.c b/gcc/testsuite/gcc.dg/pr79222.c index 7483a5e..87e9fb6 100644 --- a/gcc/testsuite/gcc.dg/pr79222.c +++ b/gcc/testsuite/gcc.dg/pr79222.c @@ -9,5 +9,5 @@ char d[3]; char* f (int i) { const char *s = i < 0 ? "01234567" : "9876543210"; - return stpcpy (d, s); /* { dg-warning ".stpcpy. writing 9 bytes into a region of size 3 overflows the destination" } */ + return stpcpy (d, s); /* { dg-warning ".stpcpy. writing between 9 and 11 bytes into a region of size 3 overflows the destination" } */ } diff --git a/gcc/testsuite/gcc.dg/pr79223.c b/gcc/testsuite/gcc.dg/pr79223.c index 5bfb1d9..295d5c1 100644 --- a/gcc/testsuite/gcc.dg/pr79223.c +++ b/gcc/testsuite/gcc.dg/pr79223.c @@ -23,15 +23,15 @@ size_t range (void) void test_memcpy (void) { - memcpy (d, s, range ()); /* { dg-warning ".memcpy. writing between 4 and \[0-9\]+ bytes into a region of size 3 overflows the destination" } */ + memcpy (d, s, range ()); /* { dg-warning ".memcpy. writing 4 or more bytes into a region of size 3 overflows the destination" } */ } void test_mempcpy (void) { - mempcpy (d, s, range ()); /* { dg-warning ".mempcpy. writing between 4 and \[0-9\]+ bytes into a region of size 3 overflows the destination" } */ + mempcpy (d, s, range ()); /* { dg-warning ".mempcpy. writing 4 or more bytes into a region of size 3 overflows the destination" } */ } void test_memmove (void) { - memmove (d + 1, d, range ()); /* { dg-warning ".memmove. writing between 4 and \[0-9\]+ bytes into a region of size 2 overflows the destination" } */ + memmove (d + 1, d, range ()); /* { dg-warning ".memmove. writing 4 or more bytes into a region of size 2 overflows the destination" } */ } diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtins-folding-gimple-ub.c b/gcc/testsuite/gcc.dg/tree-ssa/builtins-folding-gimple-ub.c index e1658d1..a313998 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/builtins-folding-gimple-ub.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/builtins-folding-gimple-ub.c @@ -13,9 +13,16 @@ main (void) /* MEMCHR. */ if (__builtin_memchr ("", 'x', 1000)) /* Not folded away. */ - __builtin_abort (); + { + /* { dg-warning "reading 1000 bytes from a region of size 1" "" { target *-*-* } .-2 } */ + __builtin_abort (); + } + if (__builtin_memchr (foo1, 'x', 1000)) /* Not folded away. */ - __builtin_abort (); + { + /* { dg-warning "reading 1000 bytes from a region of size 1" "" { target *-*-* } .-2 } */ + __builtin_abort (); + } /* STRNCMP. */ if (strncmp ("a", "b", -1)) /* { dg-warning "implicit declaration of function" } */ |