Home | History | Annotate | Download | only in ld-gc
      1 int unused_var = 7;
      2 int used_var = 7;
      3 
      4 int
      5 unused_func (int v)
      6 {
      7   return 3 * unused_var;
      8 }
      9 
     10 int
     11 __attribute__((noinline))
     12 used_func (int v)
     13 {
     14   return 2 * used_var;
     15 }
     16 
     17 int
     18 main (void)
     19 {
     20   return used_func (5);
     21 }
     22 
     23 void
     24 dummy_func (void)
     25 {
     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.  */
     31 
     32   __asm__(".ifndef main\n\
     33 .global main\n\
     34 .set main, _main\n\
     35 .endif");
     36 
     37   __asm__(".ifndef used_func\n\
     38 .global used_func\n\
     39 .set used_func, _used_func\n\
     40 .endif");
     41 }
     42