This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug testsuite/34889] New: gcc.c-torture/execute/builtins/pr23484-chk.c fails on 16 bit integer platforms


gcc.c-torture/execute/builtins/pr23484-chk.c has on line 44:

  if (snprintf (buf, l1 ? sizeof (buf) : 4, "%d", l1 + 65536) != 5
      || memcmp (buf, "655\0LLLL", 8))

but on a 16 bit platform like the avr, the "l1 + 65536" overflows and gives the
wrong result. Changing that to:

  if (snprintf (buf, l1 ? sizeof (buf) : 4, "%d", l1 + 32760) != 5
      || memcmp (buf, "327\0LLLL", 8))

fixes the problem.


-- 
           Summary: gcc.c-torture/execute/builtins/pr23484-chk.c fails on 16
                    bit integer platforms
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pmarques at grupopie dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr-*-*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34889


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]