This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Fragile test case nsdmi-union5.C
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Andrew Pinski <pinskia at gmail dot com>
- Cc: Joey Ye <joey dot ye at arm dot com>, "<gcc at gcc dot gnu dot org>" <gcc at gcc dot gnu dot org>, "<jason at redhat dot com>" <jason at redhat dot com>
- Date: Wed, 16 Apr 2014 11:35:06 +0200
- Subject: Re: Fragile test case nsdmi-union5.C
- Authentication-results: sourceware.org; auth=none
- References: <000201cf5947$67c99d10$375cd730$ at arm dot com> <E68930B7-D0BE-49C3-8300-1F074121E406 at gmail dot com>
On Wed, Apr 16, 2014 at 10:24 AM, <pinskia@gmail.com> wrote:
>
>
>> On Apr 16, 2014, at 12:42 AM, "Joey Ye" <joey.ye@arm.com> wrote:
>>
>> Ran into a fragile test case:
>> FAIL: g+.dg/cpp0x/nsdmi-union5.C -std=c+11 scan-assembler 7
>>
>> $ cat nsdmi-union5.C
>> // PR c++/58701
>> // { dg-require-effective-target c++11 }
>> // { dg-final { scan-assembler "7" } }
>>
>> static union
>> {
>> union
>> {
>> int i = 7;
>> };
>> };
>>
>> Two issues make it very fragile. It only seems to pass with -O0, as the code
>> will be optimized away with any non-O0 levels. This is somewhat acceptable,
>> but following is annoying: It scans digit 7 in resulting asm, which will
>> pass whenever
>> * Any CPU name, file name, svn/git revision number and ARM eabi_attribute
>> contain digit 7.
>> * All GCC x.7 versions
>> * Any GCC built in July or on 7th/17th/27th of the month, or in 2017
>> Actually I ran into this issue when I checked my test result with a
>> reference. Unfortunately one has digit 7 in revision number and one has not.
>>
>> I tend to just not scan anything and makes it a do-compile case against ICE.
>> But I'm not sure if there was a reason to scan the digit. Please comment.
>
>
> What about adding an explicit -O0 and doing a scan on the gimple dump?
Or make it a runtime testcase?
Richard.
> Thanks,
> Andrew
>
>>
>> Thanks,
>> Joey
>>
>>