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: XFAIL vbase10.C on ARM


The vbase10.C test is checking for correct operation of -Wabi.  The
situation that it is looking for requires that the class B have an
alignment of 1, which it does not on almost all ARM targets.
Therefore, the warning is not issued -- but that does not really
indicate a problem with the compiler; it's just a consequence of the
ARM structure layout rules.

ARM NetBSD is a special case; there, the structure alignment *is* 1,
so the test will now XPASS there.  We do not presently have a
mechanism for saying that the test is expected to FAIL everywhere
except on a particular target.

Tested on i686-pc-linux-gnu and arm-none-elf, and applied to the
mainline.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2003-12-30  Mark Mitchell  <mark@codesourcery.com>

	* g++.dg/abi/vbase10.C: XFAIL on arm*-*-*.

Index: g++.dg/abi/vbase10.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.dg/abi/vbase10.C,v
retrieving revision 1.2
diff -c -5 -p -r1.2 vbase10.C
*** g++.dg/abi/vbase10.C	23 Dec 2003 16:53:52 -0000	1.2
--- g++.dg/abi/vbase10.C	30 Dec 2003 19:33:12 -0000
***************
*** 1,7 ****
  // { dg-do compile }
  // { dg-options "-Wabi -fabi-version=1" }
  
  struct A { virtual void f(); char c1; };
  struct B { B(); char c2; };
! struct C : public A, public virtual B {}; // { dg-warning "ABI" }
  
--- 1,13 ----
  // { dg-do compile }
  // { dg-options "-Wabi -fabi-version=1" }
  
  struct A { virtual void f(); char c1; };
  struct B { B(); char c2; };
! // On ARM processors, the alignment of B will be 4 even though it
! // contains only a single "char".  That avoids the situation that the
! // warning below is designed to catch.  On ARM NetBSD, the alignment
! // of B will be only 1 -- but there is no way to tell DejaGNU that a
! // failure is expected on all ARM targets except arm*-*-netbsd*.
! // Therefore, this test will XPASS on arm*-*-netbsd*.
! struct C : public A, public virtual B {}; // { dg-warning "ABI" "" { xfail arm*-*-* } }
  


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