https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77710

            Bug ID: 77710
           Summary: FAIL: gcc.dg/tree-ssa/builtin-sprintf-warn-4.c
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: thopre01 at gcc dot gnu.org
                CC: msebor at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-linux-gnu
            Target: arm-none-eabi

Hi,

gcc.dg/tree-ssa/builtin-sprintf-warn-4.c fails on arm-none-eabi targets for
excess errors because it does not seem to see the dg-warning and dg-message
directive. This seems to be related to the multiline checks because when
removing those the warnings are catched.

Here is the output I get:

gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-4.c: In function 'test':^M
gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-4.c:10:21: warning: writing
a terminating nul past the end of the destination [-Wformat-length=]^M
   sprintf (dst + 7, "%-s", "1");^M
                     ^~~~~^M
gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-4.c:10:3: note: format
output 2 bytes into a destination of size 1^M
   sprintf (dst + 7, "%-s", "1");^M
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~^M
gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-4.c:22:22: warning: '%-s'
directive writing 4 bytes into a region of size 1 [-Wformat-length=]^M
   sprintf (dst + 7, "%-s", "abcd");^M
                      ^~~   ~~~~~~^M
gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-4.c:22:3: note: format
output 5 bytes into a destination of size 1^M
   sprintf (dst + 7, "%-s", "abcd");^M
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^M

PASS: gcc.dg/tree-ssa/builtin-sprintf-warn-4.c expected multiline pattern lines
14-15 was found: "\s*sprintf \(dst \+ 7, "%-s", "1"\);.*\n                    
\^~~~~\n"
PASS: gcc.dg/tree-ssa/builtin-sprintf-warn-4.c expected multiline pattern lines
18-19 was found: "   sprintf \(dst \+ 7, "%-s", "1"\);.*\n  
\^~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
PASS: gcc.dg/tree-ssa/builtin-sprintf-warn-4.c expected multiline pattern lines
26-27 was found: "   sprintf \(dst \+ 7, "%-s", "abcd"\);.*\n                  
   \^~~   ~~~~~~\n"
PASS: gcc.dg/tree-ssa/builtin-sprintf-warn-4.c expected multiline pattern lines
30-31 was found: "   sprintf \(dst \+ 7, "%-s", "abcd"\);.*\n  
\^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
FAIL: gcc.dg/tree-ssa/builtin-sprintf-warn-4.c (test for excess errors)
Excess errors:
gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-4.c:10:21: warning: writing
a terminating nul past the end of the destination
[-Wformat-length=]gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-4.c:22:22:
warning: '%-s' directive writing 4 bytes into a region of size 1
[-Wformat-length=]

Reply via email to