Home | History | Annotate | Download | only in COFF
      1 // This tests that default-null weak symbols (a GNU extension) are created
      2 // properly via the .weak directive.
      3 
      4 // RUN: llvm-mc -filetype=obj -triple i686-pc-win32 < %s | coff-dump.py | FileCheck %s
      5 
      6     .def    _main;
      7     .scl    2;
      8     .type   32;
      9     .endef
     10     .text
     11     .globl  _main
     12     .align  16, 0x90
     13 _main:                                  # @main
     14 # BB#0:                                 # %entry
     15     subl    $4, %esp
     16     movl    $_test_weak, %eax
     17     testl   %eax, %eax
     18     je      LBB0_2
     19 # BB#1:                                 # %if.then
     20     calll   _test_weak
     21     movl    $1, %eax
     22     addl    $4, %esp
     23     ret
     24 LBB0_2:                                 # %return
     25     xorl    %eax, %eax
     26     addl    $4, %esp
     27     ret
     28 
     29     .weak   _test_weak
     30 
     31 // CHECK: Symbols = [
     32 
     33 // CHECK:      Name               = _test_weak
     34 // CHECK-NEXT: Value              = 0
     35 // CHECK-NEXT: SectionNumber      = 0
     36 // CHECK-NEXT: SimpleType         = IMAGE_SYM_TYPE_NULL (0)
     37 // CHECK-NEXT: ComplexType        = IMAGE_SYM_DTYPE_NULL (0)
     38 // CHECK-NEXT: StorageClass       = IMAGE_SYM_CLASS_WEAK_EXTERNAL (105)
     39 // CHECK-NEXT: NumberOfAuxSymbols = 1
     40 // CHECK-NEXT: AuxillaryData      =
     41 // CHECK-NEXT: 05 00 00 00 02 00 00 00 - 00 00 00 00 00 00 00 00 |................|
     42 // CHECK-NEXT: 00 00                                             |..|
     43 
     44 // CHECK:      Name               = .weak._test_weak.default
     45 // CHECK-NEXT: Value              = 0
     46 // CHECK-NEXT: SectionNumber      = 65535
     47 // CHECK-NEXT: SimpleType         = IMAGE_SYM_TYPE_NULL (0)
     48 // CHECK-NEXT: ComplexType        = IMAGE_SYM_DTYPE_NULL (0)
     49 // CHECK-NEXT: StorageClass       = IMAGE_SYM_CLASS_EXTERNAL (2)
     50 // CHECK-NEXT: NumberOfAuxSymbols = 0
     51 // CHECK-NEXT: AuxillaryData      =
     52