annotate gcc/testsuite/gcc.dg/funcorder.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
kono
parents:
diff changeset
2 /* { dg-options "-O2 -funit-at-a-time" } */
kono
parents:
diff changeset
3 /* { dg-final { scan-assembler-not "link_error" } } */
kono
parents:
diff changeset
4 /* In unit-at-time the functions should be assembled in order
kono
parents:
diff changeset
5 e q t main, so we realize that they are pure. */
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 void link_error (void);
kono
parents:
diff changeset
8 static int mem;
kono
parents:
diff changeset
9 static int e(void) __attribute__ ((noinline));
kono
parents:
diff changeset
10 static int q(void) __attribute__ ((noinline));
kono
parents:
diff changeset
11 static int t(void) __attribute__ ((noinline));
kono
parents:
diff changeset
12 int
kono
parents:
diff changeset
13 main()
kono
parents:
diff changeset
14 {
kono
parents:
diff changeset
15 return t();
kono
parents:
diff changeset
16 }
kono
parents:
diff changeset
17 static int t()
kono
parents:
diff changeset
18 {
kono
parents:
diff changeset
19 int r,e;
kono
parents:
diff changeset
20 if (mem)
kono
parents:
diff changeset
21 t();
kono
parents:
diff changeset
22 e=mem;
kono
parents:
diff changeset
23 r=q();
kono
parents:
diff changeset
24 if (e!=mem)
kono
parents:
diff changeset
25 link_error();
kono
parents:
diff changeset
26 return r;
kono
parents:
diff changeset
27 }
kono
parents:
diff changeset
28 static int e()
kono
parents:
diff changeset
29 {
kono
parents:
diff changeset
30 return 0;
kono
parents:
diff changeset
31 }
kono
parents:
diff changeset
32 static int q()
kono
parents:
diff changeset
33 {
kono
parents:
diff changeset
34 int t=mem,r;
kono
parents:
diff changeset
35 r=e();
kono
parents:
diff changeset
36 if (t!=mem)
kono
parents:
diff changeset
37 link_error();
kono
parents:
diff changeset
38 return r;
kono
parents:
diff changeset
39 }