From: Sam James Date: Thu, 31 Oct 2024 01:37:47 +0000 (+0000) Subject: testsuite: fix syntax in Wstringop-overflow-59.c X-Git-Tag: basepoints/gcc-16~4761 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2dcb174385fd366282bf34bf95adbf918d5befda;p=thirdparty%2Fgcc.git testsuite: fix syntax in Wstringop-overflow-59.c Fix quoting issues, escaping, and dg directive types. There were two issues here: 1) The incorrect quoting in an earlier dg-message was covering up that the syntax in the next part was wrong; 2) Fix dg-warning -> dg-message to correctly pick up the notes. Once 1) was fixed, this was exposed. With this, I get: ``` +PASS: gcc.dg/Wstringop-overflow-59.c note (test for warnings, line 192) +PASS: gcc.dg/Wstringop-overflow-59.c note (test for warnings, line 193) ``` gcc/testsuite/ChangeLog: PR middle-end/92936 * gcc.dg/Wstringop-overflow-59.c: Fix dg-* syntax. --- diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-59.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-59.c index b6265e37c865..88aac3a3678a 100644 --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-59.c +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-59.c @@ -172,8 +172,8 @@ void memset_malloc_2_same_size (int i) if (i < 1) i = 1; - char a4_1[4]; // { dg-message "at offset \\\[1, 4] into destination object 'a4_1" "note" } - char a4_2[4]; // { dg-message "at offset \\\[1, 4] into destination object 'a4_2" "note" } + char a4_1[4]; // { dg-message "at offset \\\[1, 4] into destination object 'a4_1'" "note" } + char a4_2[4]; // { dg-message "at offset \\\[1, 4] into destination object 'a4_2'" "note" } char *p4 = cond1 ? a4_1 : a4_2; char *p4_i = p4 + i; @@ -189,8 +189,8 @@ void memset_malloc_2_off (void) int i2 = SR (2, INT_MAX); { - char a5[5]; // { dg-warning "at offset [1, 5] into destination object 'a5' - char a7[7]; // { dg-warning "at offset [2, 7] into destination object 'a7' + char a5[5]; // { dg-message "at offset \\\[1, 5] into destination object 'a5'" "note" } + char a7[7]; // { dg-message "at offset \\\[2, 7] into destination object 'a7'" "note" } char *p5_p1 = a5 + i1; char *p7_p2 = a7 + i2; char *p5_7 = cond1 ? p5_p1 : p7_p2;