137 lines · plain
1# RUN: yaml2obj %s | llvm-readobj --symbols - | FileCheck %s2 3# Test symbols with custom import module and name attributes.4 5--- !WASM6FileHeader: 7 Version: 0x000000018Sections: 9 - Type: TYPE10 Signatures: 11 - Index: 012 ParamTypes: []13 ReturnTypes:14 - I3215 - Index: 116 ParamTypes: []17 ReturnTypes: []18 - Type: IMPORT19 Imports: 20 - Module: env21 Field: __linear_memory22 Kind: MEMORY23 Memory: 24 Minimum: 0x0000000025 - Module: env26 Field: __indirect_function_table27 Kind: TABLE28 Table: 29 Index: 030 ElemType: FUNCREF31 Limits: 32 Minimum: 0x0000000033 - Module: red34 Field: foo35 Kind: FUNCTION36 SigIndex: 137 - Module: env38 Field: green39 Kind: FUNCTION40 SigIndex: 141 - Module: blue42 Field: purple43 Kind: FUNCTION44 SigIndex: 145 - Type: FUNCTION46 FunctionTypes: [ 0 ]47 - Type: CODE48 Relocations: 49 - Type: R_WASM_FUNCTION_INDEX_LEB50 Index: 151 Offset: 0x0000000452 - Type: R_WASM_FUNCTION_INDEX_LEB53 Index: 254 Offset: 0x0000000A55 - Type: R_WASM_FUNCTION_INDEX_LEB56 Index: 357 Offset: 0x0000001058 Functions: 59 - Index: 360 Locals: []61 Body: 10808080800010818080800010828080800041000B62 - Type: CUSTOM63 Name: linking64 Version: 265 SymbolTable: 66 - Index: 067 Kind: FUNCTION68 Name: test69 Flags: [ VISIBILITY_HIDDEN ]70 Function: 371 - Index: 172 Kind: FUNCTION73 Name: foo74 Flags: [ UNDEFINED ]75 Function: 076 - Index: 277 Kind: FUNCTION78 Name: bar79 Flags: [ UNDEFINED, EXPLICIT_NAME ]80 Function: 181 - Index: 382 Kind: FUNCTION83 Name: qux84 Flags: [ UNDEFINED, EXPLICIT_NAME ]85 Function: 286 - Type: CUSTOM87 Name: producers88 Tools: 89 - Name: clang90 Version: '9.0.0 (trunk 359436)'91...92 93# CHECK: Format: WASM94# CHECK-NEXT: Arch: wasm3295# CHECK-NEXT: AddressSize: 32bit96# CHECK-NEXT: Symbols [97# CHECK-NEXT: Symbol {98# CHECK-NEXT: Name: test99# CHECK-NEXT: Type: FUNCTION (0x0)100# CHECK-NEXT: Flags [ (0x4)101# CHECK-NEXT: VISIBILITY_HIDDEN (0x4)102# CHECK-NEXT: ]103# CHECK-NEXT: ElementIndex: 0x3104# CHECK-NEXT: }105# CHECK-NEXT: Symbol {106# CHECK-NEXT: Name: foo107# CHECK-NEXT: Type: FUNCTION (0x0)108# CHECK-NEXT: Flags [ (0x10)109# CHECK-NEXT: UNDEFINED (0x10)110# CHECK-NEXT: ]111# CHECK-NEXT: ImportModule: red112# CHECK-NEXT: ElementIndex: 0x0113# CHECK-NEXT: }114# CHECK-NEXT: Symbol {115# CHECK-NEXT: Name: bar116# CHECK-NEXT: Type: FUNCTION (0x0)117# CHECK-NEXT: Flags [ (0x50)118# CHECK-NEXT: EXPLICIT_NAME (0x40)119# CHECK-NEXT: UNDEFINED (0x10)120# CHECK-NEXT: ]121# CHECK-NEXT: ImportName: green122# CHECK-NEXT: ImportModule: env123# CHECK-NEXT: ElementIndex: 0x1124# CHECK-NEXT: }125# CHECK-NEXT: Symbol {126# CHECK-NEXT: Name: qux127# CHECK-NEXT: Type: FUNCTION (0x0)128# CHECK-NEXT: Flags [ (0x50)129# CHECK-NEXT: EXPLICIT_NAME (0x40)130# CHECK-NEXT: UNDEFINED (0x10)131# CHECK-NEXT: ]132# CHECK-NEXT: ImportName: purple133# CHECK-NEXT: ImportModule: blue134# CHECK-NEXT: ElementIndex: 0x2135# CHECK-NEXT: }136# CHECK-NEXT: ]137