Home | History | Annotate | Download | only in wasm
      1 # RUN: yaml2obj < %s | llvm-nm - | FileCheck -strict-whitespace %s
      2 
      3 # Check that wasm weak function/global/data symbols are displayed correctly
      4 
      5 --- !WASM
      6 FileHeader:
      7   Version:         0x00000001
      8 Sections:
      9   - Type:            TYPE
     10     Signatures:
     11       - Index:           0
     12         ReturnType:      I32
     13         ParamTypes:
     14           - I32
     15   - Type:            IMPORT
     16     Imports:
     17       - Module:          env
     18         Field:           weak_import_func
     19         Kind:            FUNCTION
     20         SigIndex:        0
     21   - Type:            FUNCTION
     22     FunctionTypes: [ 0 ]
     23   - Type:            GLOBAL
     24     Globals:
     25       - Index:       0
     26         Type:        I32
     27         Mutable:     false
     28         InitExpr:
     29           Opcode:          I64_CONST
     30           Value:           32
     31   - Type:            CODE
     32     Functions:
     33       - Index:           1
     34         Locals:
     35         Body:            00
     36   - Type:            DATA
     37     Segments:
     38       - SectionOffset:   6
     39         MemoryIndex:     0
     40         Offset:
     41           Opcode:          I32_CONST
     42           Value:           0
     43         Content:         '616263'
     44   - Type:            CUSTOM
     45     Name:            linking
     46     Version:         1
     47     SymbolTable:
     48        - Index:           0
     49          Kind:            DATA
     50          Name:            weak_defined_data
     51          Flags:           [ BINDING_WEAK ]
     52          Segment:         0
     53          Size:            3
     54        - Index:           1
     55          Kind:            FUNCTION
     56          Name:            weak_defined_func
     57          Flags:           [ BINDING_WEAK ]
     58          Function:        1
     59        - Index:           2
     60          Kind:            GLOBAL
     61          Name:            weak_defined_global
     62          Flags:           [ BINDING_WEAK ]
     63          Global:          0
     64        - Index:           3
     65          Kind:            DATA
     66          Name:            weak_import_data
     67          Flags:           [ BINDING_WEAK, UNDEFINED ]
     68        - Index:           4
     69          Kind:            FUNCTION
     70          Name:            weak_import_func
     71          Flags:           [ BINDING_WEAK, UNDEFINED ]
     72          Function:        0
     73     SegmentInfo:
     74       - Index:           0
     75         Name:            .rodata.constantData
     76         Alignment:       1
     77         Flags:           [  ]
     78 
     79 
     80 # CHECK:      00000000 W weak_defined_data
     81 # CHECK-NEXT: 00000001 W weak_defined_func
     82 # CHECK-NEXT: 00000000 W weak_defined_global
     83 # CHECK-NEXT:          w weak_import_data
     84 # CHECK-NEXT:          w weak_import_func
     85