Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / gcc.dg / torture / nested-fn-1.c
bloba396def7eaa8410629a4d1c468e54da365e85276
1 /* PR middle-end/15345, c/16450 */
2 /* Test whether unused nested functions aren't emitted into the assembly. */
3 /* { dg-do compile } */
4 /* { dg-options "-g0" } */
6 int
7 fn1 (int x)
9 int i = x;
10 inline __attribute__((always_inline)) int
11 should_not_appear1 (void)
13 return i;
15 return should_not_appear1 ();
18 int
19 fn2 (int x)
21 int i = x;
22 inline __attribute__((always_inline)) int
23 should_not_appear2 (void)
25 return i;
27 return x;
30 extern void check (void *p);
32 int
33 fn3 (int x)
35 int i = x;
36 inline int
37 should_appear1 (void)
39 char *p = __builtin_alloca (i);
40 check (p);
41 return i;
43 return should_appear1 ();
46 int
47 fn4 (int x)
49 int i = x;
50 inline int
51 should_not_appear3 (void)
53 char *p = __builtin_alloca (i);
54 check (p);
55 return i;
57 return 0 ? should_not_appear3 () : 1;
60 int
61 fn5 (int x)
63 int i = x;
64 inline int
65 should_appear2 (void)
67 return i;
69 check (should_appear2);
70 return i;
73 /* { dg-final { scan-assembler-not "should_not_appear" } } */