gas:
[binutils/dougsmingw.git] / ld / testsuite / ld-gc / gc.c
blob3b0e655c750f32249c17eb7b6c19ee9067829d14
1 int unused_var = 7;
2 int used_var = 7;
4 int
5 unused_func (int v)
7 return 3 * unused_var;
10 int
11 __attribute__((noinline))
12 used_func (int v)
14 return 2 * used_var;
17 int
18 main (void)
20 return used_func (5);
23 void
24 dummy_func (void)
26 /* These are here in case the target prepends an underscore to
27 the start of function names. They are inside a dummy function
28 so that they will appear at the end of gcc's assembler output,
29 after the definitions of main() and used_func(), rather than
30 at the beginning of the file. */
32 __asm__(".ifndef main\n\
33 .global main\n\
34 .set main, _main\n\
35 .endif");
37 __asm__(".ifndef used_func\n\
38 .global used_func\n\
39 .set used_func, _used_func\n\
40 .endif");