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]

Re: [PATCH, testsuite] Fix usage of sizeof in testsuite/g++.dg/cpp0x/rv[1..8]p.C


On Fri, Aug 13, 2010 at 10:43 PM, Ian Lance Taylor <iant@google.com> wrote:

> Hmmm, actually, looking at the patch, I'm not sure this is the best
> approach. ?The problem is that your patch means that some of the tests
> no longer actually test anything. ?E.g., in rv2p.C, we have this:
>
> ? ?sa<sizeof(sink_2_13(a)) ? ? ? ? ? == 1> t1;
> ? ?sa<sizeof(sink_2_13(va)) ? ? ? ? ?== 3> t3;
>
> The point of this test is to check function overloading. ?Change both
> instances to != 0 means that the test is no longer testing anything.
>
> So a better approach here is going to be to change the fields from,
> e.g., "char" to "long", and change the tests to be N * sizeof(long).

Thanks, attached is fixed patch that implements your suggestion.

2010-08-14  Uros Bizjak  <ubizjak@gmail.com>

	* g++.dg/cast.C: Change fields of structures to "long" to pass
	the test on targets with STRUCTURE_SIZE_BOUNDARY != BITS_PER_UNIT.
	* g++.dg/cpp0x/iop.C: Ditto.
	* g++.dg/cpp0x/named_refs.C: Ditto.
	* g++.dg/cpp0x/rv1p.C: Ditto.
	* g++.dg/cpp0x/rv2p.C: Ditto.
	* g++.dg/cpp0x/rv3p.C: Ditto.
	* g++.dg/cpp0x/rv4p.C: Ditto.
	* g++.dg/cpp0x/rv5p.C: Ditto.
	* g++.dg/cpp0x/rv6p.C: Ditto.
	* g++.dg/cpp0x/rv7p.C: Ditto.
	* g++.dg/cpp0x/rv8p.C: Ditto.
	* g++.dg/cpp0x/unnamed_refs.C: Ditto.

Patch was tested on x86_64-pc-linux-gnu and committed to mainline SVN.

Uros.

Attachment: t.diff.txt.bz2
Description: BZip2 compressed data


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