diff options
| author | Sam Clegg <sbc@chromium.org> | 2018-01-09 21:38:53 +0000 |
|---|---|---|
| committer | Sam Clegg <sbc@chromium.org> | 2018-01-09 21:38:53 +0000 |
| commit | e53af7f6df2cabaa62516e32ae00aaf271258fa4 (patch) | |
| tree | dac521f63a63655bedd0ea9cb27429a8943ea6cb /llvm/test/ObjectYAML | |
| parent | d68fa1be57ae66236af53f7a16e78309d2aecdea (diff) | |
| download | bcm5719-llvm-e53af7f6df2cabaa62516e32ae00aaf271258fa4.tar.gz bcm5719-llvm-e53af7f6df2cabaa62516e32ae00aaf271258fa4.zip | |
[WebAssembly] Explicitly specify function/global index space in YAML
These indexes are useful because they are not always zero based and
functions and globals are referenced elsewhere by their index.
This matches what we already do for the type index space.
Differential Revision: https://reviews.llvm.org/D41877
llvm-svn: 322121
Diffstat (limited to 'llvm/test/ObjectYAML')
| -rw-r--r-- | llvm/test/ObjectYAML/wasm/code_section.yaml | 18 | ||||
| -rw-r--r-- | llvm/test/ObjectYAML/wasm/export_section.yaml | 6 | ||||
| -rw-r--r-- | llvm/test/ObjectYAML/wasm/global_section.yaml | 6 | ||||
| -rw-r--r-- | llvm/test/ObjectYAML/wasm/import_section.yaml | 3 | ||||
| -rw-r--r-- | llvm/test/ObjectYAML/wasm/linking_section.yaml | 3 | ||||
| -rw-r--r-- | llvm/test/ObjectYAML/wasm/name_section.yaml | 3 | ||||
| -rw-r--r-- | llvm/test/ObjectYAML/wasm/start_section.yaml | 3 | ||||
| -rw-r--r-- | llvm/test/ObjectYAML/wasm/type_section.yaml | 6 | ||||
| -rw-r--r-- | llvm/test/ObjectYAML/wasm/weak_symbols.yaml | 6 |
9 files changed, 36 insertions, 18 deletions
diff --git a/llvm/test/ObjectYAML/wasm/code_section.yaml b/llvm/test/ObjectYAML/wasm/code_section.yaml index 5359d2a100c..4f7da6725ec 100644 --- a/llvm/test/ObjectYAML/wasm/code_section.yaml +++ b/llvm/test/ObjectYAML/wasm/code_section.yaml @@ -5,10 +5,12 @@ FileHeader: Sections: - Type: TYPE Signatures: - - ReturnType: F32 + - Index: 0 + ReturnType: F32 ParamTypes: - I32 - - ReturnType: NORESULT + - Index: 1 + ReturnType: NORESULT ParamTypes: - I32 - I64 @@ -25,11 +27,13 @@ Sections: Index: 1 Offset: 0x00000025 Functions: - - Locals: + - Index: 0 + Locals: - Type: I32 Count: 3 Body: 418080808000210020002101200111808080800000210220020F0B - - Locals: + - Index: 1 + Locals: - Type: I32 Count: 1 Body: 108180808000210020000F0B @@ -58,11 +62,13 @@ Sections: # CHECK: Index: 1 # CHECK: Offset: 0x00000025 # CHECK: Functions: -# CHECK: - Locals: +# CHECK: - Index: 0 +# CHECK: Locals: # CHECK: - Type: I32 # CHECK: Count: 3 # CHECK: Body: 418080808000210020002101200111808080800000210220020F0B -# CHECK: - Locals: +# CHECK: - Index: 1 +# CHECK: Locals: # CHECK: - Type: I32 # CHECK: Count: 1 # CHECK: Body: 108180808000210020000F0B diff --git a/llvm/test/ObjectYAML/wasm/export_section.yaml b/llvm/test/ObjectYAML/wasm/export_section.yaml index 8c5f57c2992..4dd62bde2c6 100644 --- a/llvm/test/ObjectYAML/wasm/export_section.yaml +++ b/llvm/test/ObjectYAML/wasm/export_section.yaml @@ -7,12 +7,14 @@ Sections: FunctionTypes: [ 0, 0 ] - Type: GLOBAL Globals: - - Type: I32 + - Index: 0 + Type: I32 Mutable: false InitExpr: Opcode: I64_CONST Value: 32 - - Type: I32 + - Index: 1 + Type: I32 Mutable: false InitExpr: Opcode: I64_CONST diff --git a/llvm/test/ObjectYAML/wasm/global_section.yaml b/llvm/test/ObjectYAML/wasm/global_section.yaml index 3f17c6d88ba..73e50b57f5d 100644 --- a/llvm/test/ObjectYAML/wasm/global_section.yaml +++ b/llvm/test/ObjectYAML/wasm/global_section.yaml @@ -5,7 +5,8 @@ FileHeader: Sections: - Type: GLOBAL Globals: - - Type: I32 + - Index: 0 + Type: I32 Mutable: false InitExpr: Opcode: I64_CONST @@ -17,7 +18,8 @@ Sections: # CHECK: Sections: # CHECK: - Type: GLOBAL # CHECK: Globals: -# CHECK: - Type: I32 +# CHECK: - Index: 0 +# CHECK: Type: I32 # CHECK: Mutable: false # CHECK: InitExpr: # CHECK: Opcode: I64_CONST diff --git a/llvm/test/ObjectYAML/wasm/import_section.yaml b/llvm/test/ObjectYAML/wasm/import_section.yaml index 000b4c270c3..fc75705ab2c 100644 --- a/llvm/test/ObjectYAML/wasm/import_section.yaml +++ b/llvm/test/ObjectYAML/wasm/import_section.yaml @@ -5,7 +5,8 @@ FileHeader: Sections: - Type: TYPE Signatures: - - ReturnType: I32 + - Index: 0 + ReturnType: I32 ParamTypes: - I32 - Type: IMPORT diff --git a/llvm/test/ObjectYAML/wasm/linking_section.yaml b/llvm/test/ObjectYAML/wasm/linking_section.yaml index e413bd3f1ea..fdb6d256a57 100644 --- a/llvm/test/ObjectYAML/wasm/linking_section.yaml +++ b/llvm/test/ObjectYAML/wasm/linking_section.yaml @@ -5,7 +5,8 @@ FileHeader: Sections: - Type: TYPE Signatures: - - ReturnType: I32 + - Index: 0 + ReturnType: I32 ParamTypes: - I32 - Type: IMPORT diff --git a/llvm/test/ObjectYAML/wasm/name_section.yaml b/llvm/test/ObjectYAML/wasm/name_section.yaml index 0a4191dd054..f7a489d7542 100644 --- a/llvm/test/ObjectYAML/wasm/name_section.yaml +++ b/llvm/test/ObjectYAML/wasm/name_section.yaml @@ -5,7 +5,8 @@ FileHeader: Sections: - Type: TYPE Signatures: - - ReturnType: I32 + - Index: 0 + ReturnType: I32 ParamTypes: - I32 - Type: IMPORT diff --git a/llvm/test/ObjectYAML/wasm/start_section.yaml b/llvm/test/ObjectYAML/wasm/start_section.yaml index 38feebcdf99..7d5e5964395 100644 --- a/llvm/test/ObjectYAML/wasm/start_section.yaml +++ b/llvm/test/ObjectYAML/wasm/start_section.yaml @@ -6,7 +6,8 @@ FileHeader: Sections: - Type: TYPE Signatures: - - ReturnType: I32 + - Index: 0 + ReturnType: I32 ParamTypes: - F32 - F32 diff --git a/llvm/test/ObjectYAML/wasm/type_section.yaml b/llvm/test/ObjectYAML/wasm/type_section.yaml index d6602595a60..a87949fed06 100644 --- a/llvm/test/ObjectYAML/wasm/type_section.yaml +++ b/llvm/test/ObjectYAML/wasm/type_section.yaml @@ -5,11 +5,13 @@ FileHeader: Sections: - Type: TYPE Signatures: - - ReturnType: I32 + - Index: 0 + ReturnType: I32 ParamTypes: - F32 - F32 - - ReturnType: I64 + - Index: 1 + ReturnType: I64 ParamTypes: - F64 - F64 diff --git a/llvm/test/ObjectYAML/wasm/weak_symbols.yaml b/llvm/test/ObjectYAML/wasm/weak_symbols.yaml index 9af2e54fe58..c12ef24633a 100644 --- a/llvm/test/ObjectYAML/wasm/weak_symbols.yaml +++ b/llvm/test/ObjectYAML/wasm/weak_symbols.yaml @@ -5,13 +5,15 @@ FileHeader: Sections: - Type: TYPE Signatures: - - ReturnType: I32 + - Index: 0 + ReturnType: I32 ParamTypes: - Type: FUNCTION FunctionTypes: [ 0, 0 ] - Type: GLOBAL Globals: - - Type: I32 + - Index: 0 + Type: I32 Mutable: false InitExpr: Opcode: I32_CONST |

