This is the mail archive of the gcc-patches@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]

[PATCH] Testcases gcc.c-torture/execute/20041218-2.c, gcc.dg/intmax_t-1.con arm-none-elf


Hi,

This patch fixes two testsuite glitches on arm-none-elf. The patch was made against the 4.0 branch, but the problems still apply on head.

The first is gcc.c-torture/execute/20041218-2.c, which wrongly assumes no padding will be applied to a char array inside a struct (such an entity is padded to 32-bits on most ARM targets). I've added __attribute__((packed)) here which lets the test pass, but I'm not sure if that's the right thing to do (i.e., whether that would still trigger the problem the testcase was supposed to check for in the first place).

The second assumes presence of <inttypes.h>, which isn't there on arm-none-elf, so I've added *arm*-*-*elf* to the list of targets which are skipped for that test.

Tested by running the testsuite for 4.0 on arm-none-elf.

OK for head? 4.0?

ChangeLog:

    * gcc.c-torture/execute/20041218-2.c: Add __attribute__((packed)).
    * gcc.dg/intmax_t-1.c: Disable on *arm*-*-*elf*.
Index: gcc/testsuite/gcc.c-torture/execute/20041218-2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/20041218-2.c,v
retrieving revision 1.1
diff -c -p -r1.1 20041218-2.c
*** gcc/testsuite/gcc.c-torture/execute/20041218-2.c	19 Dec 2004 04:07:54 -0000	1.1
--- gcc/testsuite/gcc.c-torture/execute/20041218-2.c	10 May 2005 15:29:27 -0000
*************** extern void abort (void);
*** 2,8 ****
  
  int test(int n)
  {
!   struct s { char b[n]; };
    n++;
    return sizeof(struct s);
  }
--- 2,8 ----
  
  int test(int n)
  {
!   struct s { char b[n]; } __attribute__((packed));
    n++;
    return sizeof(struct s);
  }
Index: gcc/testsuite/gcc.dg/intmax_t-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/intmax_t-1.c,v
retrieving revision 1.4
diff -c -p -r1.4 intmax_t-1.c
*** gcc/testsuite/gcc.dg/intmax_t-1.c	27 Jan 2005 20:02:56 -0000	1.4
--- gcc/testsuite/gcc.dg/intmax_t-1.c	10 May 2005 15:29:29 -0000
***************
*** 1,6 ****
  /* { dg-do compile } */
  /* { dg-options "-Wall" } */
! /* { dg-error "" "" { target *-*-solaris2.5.1 mmix-*-* mips*-*-elf* } 0 } */
  
  /* Compile with -Wall to get a warning if built-in and system intmax_t don't
     match.  */
--- 1,6 ----
  /* { dg-do compile } */
  /* { dg-options "-Wall" } */
! /* { dg-error "" "" { target *-*-solaris2.5.1 mmix-*-* mips*-*-elf* *arm*-*-*elf* } 0 } */
  
  /* Compile with -Wall to get a warning if built-in and system intmax_t don't
     match.  */

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