Corrected date in changelog
[official-gcc.git] / gcc / testsuite / gcc.dg / funcorder.c
blob9e4d8dedd8da551cc9978608ec72426c059b02e7
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -funit-at-a-time" } */
3 /* { dg-final { scan-assembler-not "link_error" } } */
4 /* In unit-at-time the functions should be assembled in order
5 e q t main, so we realize that they are pure. */
7 void link_error (void);
8 static int mem;
9 static int e(void) __attribute__ ((noinline));
10 static int q(void) __attribute__ ((noinline));
11 static int t(void) __attribute__ ((noinline));
12 int
13 main()
15 return t();
17 static int t()
19 int r,e;
20 if (mem)
21 t();
22 e=mem;
23 r=q();
24 if (e!=mem)
25 link_error();
26 return r;
28 static int e()
30 return 0;
32 static int q()
34 int t=mem,r;
35 r=e();
36 if (t!=mem)
37 link_error();
38 return r;