Home | History | Annotate | Download | only in ELF
      1 // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump  | FileCheck %s
      2 
      3 // This is a long test that checks that the aliases created by weakref are
      4 // never in the symbol table and that the only case it causes a symbol to
      5 // be output as a weak undefined symbol is if that variable is not defined
      6 // in this file and all the references to it are done via the alias.
      7 
      8         .weakref foo1, bar1
      9 
     10         .weakref foo2, bar2
     11         .long bar2
     12 
     13         .weakref foo3, bar3
     14         .long foo3
     15 
     16         .weakref foo4, bar4
     17         .long foo4
     18         .long bar4
     19 
     20         .weakref foo5, bar5
     21         .long bar5
     22         .long foo5
     23 
     24 bar6:
     25         .weakref foo6, bar6
     26 
     27 bar7:
     28         .weakref foo7, bar7
     29         .long bar7
     30 
     31 bar8:
     32         .weakref foo8, bar8
     33         .long foo8
     34 
     35 bar9:
     36         .weakref foo9, bar9
     37         .long foo9
     38         .long bar9
     39 
     40 bar10:
     41         .global bar10
     42         .weakref foo10, bar10
     43         .long bar10
     44         .long foo10
     45 
     46 bar11:
     47         .global bar11
     48         .weakref foo11, bar11
     49 
     50 bar12:
     51         .global bar12
     52         .weakref foo12, bar12
     53         .long bar12
     54 
     55 bar13:
     56         .global bar13
     57         .weakref foo13, bar13
     58         .long foo13
     59 
     60 bar14:
     61         .global bar14
     62         .weakref foo14, bar14
     63         .long foo14
     64         .long bar14
     65 
     66 bar15:
     67         .global bar15
     68         .weakref foo15, bar15
     69         .long bar15
     70         .long foo15
     71 
     72 // CHECK:       # Symbol 0x00000000
     73 // CHECK-NEXT:  (('st_name', 0x00000000) # ''
     74 // CHECK-NEXT:   ('st_bind', 0x00000000)
     75 // CHECK-NEXT:   ('st_type', 0x00000000)
     76 // CHECK-NEXT:   ('st_other', 0x00000000)
     77 // CHECK-NEXT:   ('st_shndx', 0x00000000)
     78 // CHECK-NEXT:   ('st_value', 0x0000000000000000)
     79 // CHECK-NEXT:   ('st_size', 0x0000000000000000)
     80 // CHECK-NEXT:  ),
     81 // CHECK-NEXT:  # Symbol 0x00000001
     82 // CHECK-NEXT:  (('st_name', 0x00000015) # 'bar6'
     83 // CHECK-NEXT:   ('st_bind', 0x00000000)
     84 // CHECK-NEXT:   ('st_type', 0x00000000)
     85 // CHECK-NEXT:   ('st_other', 0x00000000)
     86 // CHECK-NEXT:   ('st_shndx', 0x00000001)
     87 // CHECK-NEXT:   ('st_value', 0x0000000000000018)
     88 // CHECK-NEXT:   ('st_size', 0x0000000000000000)
     89 // CHECK-NEXT:  ),
     90 // CHECK-NEXT:  # Symbol 0x00000002
     91 // CHECK-NEXT:  (('st_name', 0x0000001a) # 'bar7'
     92 // CHECK-NEXT:   ('st_bind', 0x00000000)
     93 // CHECK-NEXT:   ('st_type', 0x00000000)
     94 // CHECK-NEXT:   ('st_other', 0x00000000)
     95 // CHECK-NEXT:   ('st_shndx', 0x00000001)
     96 // CHECK-NEXT:   ('st_value', 0x0000000000000018)
     97 // CHECK-NEXT:   ('st_size', 0x0000000000000000)
     98 // CHECK-NEXT:  ),
     99 // CHECK-NEXT:  # Symbol 0x00000003
    100 // CHECK-NEXT:  (('st_name', 0x0000001f) # 'bar8'
    101 // CHECK-NEXT:   ('st_bind', 0x00000000)
    102 // CHECK-NEXT:   ('st_type', 0x00000000)
    103 // CHECK-NEXT:   ('st_other', 0x00000000)
    104 // CHECK-NEXT:   ('st_shndx', 0x00000001)
    105 // CHECK-NEXT:   ('st_value', 0x000000000000001c)
    106 // CHECK-NEXT:   ('st_size', 0x0000000000000000)
    107 // CHECK-NEXT:  ),
    108 // CHECK-NEXT:  # Symbol 0x00000004
    109 // CHECK-NEXT:  (('st_name', 0x00000024) # 'bar9'
    110 // CHECK-NEXT:   ('st_bind', 0x00000000)
    111 // CHECK-NEXT:   ('st_type', 0x00000000)
    112 // CHECK-NEXT:   ('st_other', 0x00000000)
    113 // CHECK-NEXT:   ('st_shndx', 0x00000001)
    114 // CHECK-NEXT:   ('st_value', 0x0000000000000020)
    115 // CHECK-NEXT:   ('st_size', 0x0000000000000000)
    116 // CHECK-NEXT:  ),
    117 // CHECK-NEXT:  # Symbol 0x00000005
    118 // CHECK-NEXT:  (('st_name', 0x00000000) # ''
    119 // CHECK-NEXT:   ('st_bind', 0x00000000)
    120 // CHECK-NEXT:   ('st_type', 0x00000003)
    121 // CHECK-NEXT:   ('st_other', 0x00000000)
    122 // CHECK-NEXT:   ('st_shndx', 0x00000001)
    123 // CHECK-NEXT:   ('st_value', 0x0000000000000000)
    124 // CHECK-NEXT:   ('st_size', 0x0000000000000000)
    125 // CHECK-NEXT:  ),
    126 // CHECK-NEXT:  # Symbol 0x00000006
    127 // CHECK-NEXT:  (('st_name', 0x00000000) # ''
    128 // CHECK-NEXT:   ('st_bind', 0x00000000)
    129 // CHECK-NEXT:   ('st_type', 0x00000003)
    130 // CHECK-NEXT:   ('st_other', 0x00000000)
    131 // CHECK-NEXT:   ('st_shndx', 0x00000003)
    132 // CHECK-NEXT:   ('st_value', 0x0000000000000000)
    133 // CHECK-NEXT:   ('st_size', 0x0000000000000000)
    134 // CHECK-NEXT:  ),
    135 // CHECK-NEXT:  # Symbol 0x00000007
    136 // CHECK-NEXT:  (('st_name', 0x00000000) # ''
    137 // CHECK-NEXT:   ('st_bind', 0x00000000)
    138 // CHECK-NEXT:   ('st_type', 0x00000003)
    139 // CHECK-NEXT:   ('st_other', 0x00000000)
    140 // CHECK-NEXT:   ('st_shndx', 0x00000004)
    141 // CHECK-NEXT:   ('st_value', 0x0000000000000000)
    142 // CHECK-NEXT:   ('st_size', 0x0000000000000000)
    143 // CHECK-NEXT:  ),
    144 // CHECK-NEXT:  # Symbol 0x00000008
    145 // CHECK-NEXT:  (('st_name', 0x00000029) # 'bar10'
    146 // CHECK-NEXT:   ('st_bind', 0x00000001)
    147 // CHECK-NEXT:   ('st_type', 0x00000000)
    148 // CHECK-NEXT:   ('st_other', 0x00000000)
    149 // CHECK-NEXT:   ('st_shndx', 0x00000001)
    150 // CHECK-NEXT:   ('st_value', 0x0000000000000028)
    151 // CHECK-NEXT:   ('st_size', 0x0000000000000000)
    152 // CHECK-NEXT:  ),
    153 // CHECK-NEXT:  # Symbol 0x00000009
    154 // CHECK-NEXT:  (('st_name', 0x0000002f) # 'bar11'
    155 // CHECK-NEXT:   ('st_bind', 0x00000001)
    156 // CHECK-NEXT:   ('st_type', 0x00000000)
    157 // CHECK-NEXT:   ('st_other', 0x00000000)
    158 // CHECK-NEXT:   ('st_shndx', 0x00000001)
    159 // CHECK-NEXT:   ('st_value', 0x0000000000000030)
    160 // CHECK-NEXT:   ('st_size', 0x0000000000000000)
    161 // CHECK-NEXT:  ),
    162 // CHECK-NEXT:  # Symbol 0x0000000a
    163 // CHECK-NEXT:  (('st_name', 0x00000035) # 'bar12'
    164 // CHECK-NEXT:   ('st_bind', 0x00000001)
    165 // CHECK-NEXT:   ('st_type', 0x00000000)
    166 // CHECK-NEXT:   ('st_other', 0x00000000)
    167 // CHECK-NEXT:   ('st_shndx', 0x00000001)
    168 // CHECK-NEXT:   ('st_value', 0x0000000000000030)
    169 // CHECK-NEXT:   ('st_size', 0x0000000000000000)
    170 // CHECK-NEXT:  ),
    171 // CHECK-NEXT:  # Symbol 0x0000000b
    172 // CHECK-NEXT:  (('st_name', 0x0000003b) # 'bar13'
    173 // CHECK-NEXT:   ('st_bind', 0x00000001)
    174 // CHECK-NEXT:   ('st_type', 0x00000000)
    175 // CHECK-NEXT:   ('st_other', 0x00000000)
    176 // CHECK-NEXT:   ('st_shndx', 0x00000001)
    177 // CHECK-NEXT:   ('st_value', 0x0000000000000034)
    178 // CHECK-NEXT:   ('st_size', 0x0000000000000000)
    179 // CHECK-NEXT:  ),
    180 // CHECK-NEXT:  # Symbol 0x0000000c
    181 // CHECK-NEXT:  (('st_name', 0x00000041) # 'bar14'
    182 // CHECK-NEXT:   ('st_bind', 0x00000001)
    183 // CHECK-NEXT:   ('st_type', 0x00000000)
    184 // CHECK-NEXT:   ('st_other', 0x00000000)
    185 // CHECK-NEXT:   ('st_shndx', 0x00000001)
    186 // CHECK-NEXT:   ('st_value', 0x0000000000000038)
    187 // CHECK-NEXT:   ('st_size', 0x0000000000000000)
    188 // CHECK-NEXT:  ),
    189 // CHECK-NEXT:  # Symbol 0x0000000d
    190 // CHECK-NEXT:  (('st_name', 0x00000047) # 'bar15'
    191 // CHECK-NEXT:   ('st_bind', 0x00000001)
    192 // CHECK-NEXT:   ('st_type', 0x00000000)
    193 // CHECK-NEXT:   ('st_other', 0x00000000)
    194 // CHECK-NEXT:   ('st_shndx', 0x00000001)
    195 // CHECK-NEXT:   ('st_value', 0x0000000000000040)
    196 // CHECK-NEXT:   ('st_size', 0x0000000000000000)
    197 // CHECK-NEXT:  ),
    198 // CHECK-NEXT:  # Symbol 0x0000000e
    199 // CHECK-NEXT:  (('st_name', 0x00000001) # 'bar2'
    200 // CHECK-NEXT:   ('st_bind', 0x00000001)
    201 // CHECK-NEXT:   ('st_type', 0x00000000)
    202 // CHECK-NEXT:   ('st_other', 0x00000000)
    203 // CHECK-NEXT:   ('st_shndx', 0x00000000)
    204 // CHECK-NEXT:   ('st_value', 0x0000000000000000)
    205 // CHECK-NEXT:   ('st_size', 0x0000000000000000)
    206 // CHECK-NEXT:  ),
    207 // CHECK-NEXT:  # Symbol 0x0000000f
    208 // CHECK-NEXT:  (('st_name', 0x00000006) # 'bar3'
    209 // CHECK-NEXT:   ('st_bind', 0x00000002)
    210 // CHECK-NEXT:   ('st_type', 0x00000000)
    211 // CHECK-NEXT:   ('st_other', 0x00000000)
    212 // CHECK-NEXT:   ('st_shndx', 0x00000000)
    213 // CHECK-NEXT:   ('st_value', 0x0000000000000000)
    214 // CHECK-NEXT:   ('st_size', 0x0000000000000000)
    215 // CHECK-NEXT:  ),
    216 // CHECK-NEXT:  # Symbol 0x00000010
    217 // CHECK-NEXT:  (('st_name', 0x0000000b) # 'bar4'
    218 // CHECK-NEXT:   ('st_bind', 0x00000001)
    219 // CHECK-NEXT:   ('st_type', 0x00000000)
    220 // CHECK-NEXT:   ('st_other', 0x00000000)
    221 // CHECK-NEXT:   ('st_shndx', 0x00000000)
    222 // CHECK-NEXT:   ('st_value', 0x0000000000000000)
    223 // CHECK-NEXT:   ('st_size', 0x0000000000000000)
    224 // CHECK-NEXT:  ),
    225 // CHECK-NEXT:  # Symbol 0x00000011
    226 // CHECK-NEXT:  (('st_name', 0x00000010) # 'bar5'
    227 // CHECK-NEXT:   ('st_bind', 0x00000001)
    228 // CHECK-NEXT:   ('st_type', 0x00000000)
    229 // CHECK-NEXT:   ('st_other', 0x00000000)
    230 // CHECK-NEXT:   ('st_shndx', 0x00000000)
    231 // CHECK-NEXT:   ('st_value', 0x0000000000000000)
    232 // CHECK-NEXT:   ('st_size', 0x0000000000000000)
    233 // CHECK-NEXT:  ),
    234 // CHECK-NEXT: ])
    235