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 2/2] Add test cases for noreorder


On Sep 14, 2014, at 10:51 AM, Andi Kleen <andi@firstfloor.org> wrote:
> From: Andi Kleen <ak@linux.intel.com>
> 
> Add some simple test cases for noreorder behaving like
> -fno-toplevel-reorder and -fno-toplevel-reorder still working.
> Unfortunately there's no easy way to check for output order in DG,
> so we just check for existence.

I thought some of these would span lines…. foo.*bar  could check foo on a line before bar?

/* { dg-final { scan-assembler "section.*foo" } } */

int foo (int a)
{
  static const int ar[] = { &&l1 - &&l1, &&l2 - &&l1 };
  void *p = &&l1 + ar[a];
  goto *p;
  l1:
    return 1;
  l2:
    return 2;
}

Yup, works just fine.  Some might say it isn’t a feature, but we have no plans to fix it.

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