This is the mail archive of the gcc@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: Fragile test case nsdmi-union5.C



> 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?

Thanks,
Andrew

> 
> Thanks,
> Joey
> 
> 


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