]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: fix syntax in Wstringop-overflow-59.c
authorSam James <sam@gentoo.org>
Thu, 31 Oct 2024 01:37:47 +0000 (01:37 +0000)
committerSam James <sam@gentoo.org>
Thu, 31 Oct 2024 01:41:05 +0000 (01:41 +0000)
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.

gcc/testsuite/gcc.dg/Wstringop-overflow-59.c

index b6265e37c8657dfc20906e51edb6bc143c17fd7d..88aac3a3678af60fdf6e68520054c0a88c0a067d 100644 (file)
@@ -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;