Commit f704cf4c by Andi Kleen Committed by Andi Kleen

Add test cases for noreorder

Add some simple test cases for noreorder behaving like
-fno-toplevel-reorder and -fno-toplevel-reorder still working.

gcc/testsuite/:

2014-09-23  Andi Kleen  <ak@linux.intel.com>

	* gcc.dg/noreorder.c: New test.
	* gcc.dg/noreorder2.c: New test.
	* gcc.dg/noreorder3.c: New test.
	* gcc.dg/noreorder4.c: New test.

From-SVN: r215538
parent 7861b648
2014-09-23 Andi Kleen <ak@linux.intel.com>
* gcc.dg/noreorder.c: New test.
* gcc.dg/noreorder2.c: New test.
* gcc.dg/noreorder3.c: New test.
* gcc.dg/noreorder4.c: New test.
2014-09-23 Alan Lawrence <alan.lawrence@arm.com> 2014-09-23 Alan Lawrence <alan.lawrence@arm.com>
* gcc.dg/combine_ashiftrt_1.c: New test. * gcc.dg/combine_ashiftrt_1.c: New test.
......
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* The function order in this file is opposite from what the cgraph
topological sort would output. So we can check the order is preserved. */
extern void f2(int);
static int func2(void);
#ifndef NOREORDER
#define NOREORDER __attribute__((no_reorder))
#endif
asm("firstasm");
NOREORDER __attribute__((noinline)) int bozo(void)
{
f2(3);
func2();
}
asm("jukjuk");
NOREORDER __attribute__((noinline)) static int func1(void)
{
f2(1);
}
asm("barbar");
NOREORDER __attribute__((noinline)) static int func2(void)
{
func1();
}
asm("lastasm");
/* { dg-final { scan-assembler "firstasm.*bozo.*jukjuk.*func1.*barbar.*func2.*lastasm" } } */
/* { dg-do compile } */
/* { dg-options "-O2 -fno-toplevel-reorder" } */
__attribute__((no_reorder)) int foobar;
static int barbar;
int bozo;
/* { dg-final { scan-assembler "foobar" } } */
/* { dg-final { scan-assembler "bozo" } } */
/* { dg-final { scan-assembler "barbar" } } */
/* { dg-do compile } */
/* { dg-options "-O2" } */
__attribute__((no_reorder)) int foobar;
static int barbar;
int bozo;
/* { dg-final { scan-assembler "foobar" } } */
/* { dg-final { scan-assembler "bozo" } } */
/* { dg-final { scan-assembler-not "barbar" } } */
/* { dg-do compile } */
/* { dg-options "-O2 -fno-toplevel-reorder" } */
#define NOREORDER
#include "noreorder.c"
/* { dg-final { scan-assembler "bozo.*jukjuk.*func1.*barbar.*func2" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment