summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2018-01-09 21:38:53 +0000
committerSam Clegg <sbc@chromium.org>2018-01-09 21:38:53 +0000
commite53af7f6df2cabaa62516e32ae00aaf271258fa4 (patch)
treedac521f63a63655bedd0ea9cb27429a8943ea6cb /llvm/test
parentd68fa1be57ae66236af53f7a16e78309d2aecdea (diff)
downloadbcm5719-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')
-rw-r--r--llvm/test/MC/WebAssembly/bss.ll12
-rw-r--r--llvm/test/MC/WebAssembly/explicit-sections.ll12
-rw-r--r--llvm/test/MC/WebAssembly/init-fini-array.ll15
-rw-r--r--llvm/test/MC/WebAssembly/unnamed-data.ll12
-rw-r--r--llvm/test/MC/WebAssembly/weak-alias.ll24
-rw-r--r--llvm/test/ObjectYAML/wasm/code_section.yaml18
-rw-r--r--llvm/test/ObjectYAML/wasm/export_section.yaml6
-rw-r--r--llvm/test/ObjectYAML/wasm/global_section.yaml6
-rw-r--r--llvm/test/ObjectYAML/wasm/import_section.yaml3
-rw-r--r--llvm/test/ObjectYAML/wasm/linking_section.yaml3
-rw-r--r--llvm/test/ObjectYAML/wasm/name_section.yaml3
-rw-r--r--llvm/test/ObjectYAML/wasm/start_section.yaml3
-rw-r--r--llvm/test/ObjectYAML/wasm/type_section.yaml6
-rw-r--r--llvm/test/ObjectYAML/wasm/weak_symbols.yaml6
-rw-r--r--llvm/test/tools/llvm-nm/wasm/exports.yaml34
-rw-r--r--llvm/test/tools/llvm-nm/wasm/imports.yaml3
-rw-r--r--llvm/test/tools/llvm-nm/wasm/weak-symbols.yaml16
17 files changed, 117 insertions, 65 deletions
diff --git a/llvm/test/MC/WebAssembly/bss.ll b/llvm/test/MC/WebAssembly/bss.ll
index 66fad935fd8..b9b868a2fd4 100644
--- a/llvm/test/MC/WebAssembly/bss.ll
+++ b/llvm/test/MC/WebAssembly/bss.ll
@@ -9,22 +9,26 @@
; CHECK: - Type: GLOBAL
; CHECK-NEXT: Globals:
-; CHECK-NEXT: - Type: I32
+; CHECK-NEXT: - Index: 0
+; CHECK-NEXT: Type: I32
; CHECK-NEXT: Mutable: false
; CHECK-NEXT: InitExpr:
; CHECK-NEXT: Opcode: I32_CONST
; CHECK-NEXT: Value: 0
-; CHECK-NEXT: - Type: I32
+; CHECK-NEXT: - Index: 1
+; CHECK-NEXT: Type: I32
; CHECK-NEXT: Mutable: false
; CHECK-NEXT: InitExpr:
; CHECK-NEXT: Opcode: I32_CONST
; CHECK-NEXT: Value: 4
-; CHECK-NEXT: - Type: I32
+; CHECK-NEXT: - Index: 2
+; CHECK-NEXT: Type: I32
; CHECK-NEXT: Mutable: false
; CHECK-NEXT: InitExpr:
; CHECK-NEXT: Opcode: I32_CONST
; CHECK-NEXT: Value: 8
-; CHECK-NEXT: - Type: I32
+; CHECK-NEXT: - Index: 3
+; CHECK-NEXT: Type: I32
; CHECK-NEXT: Mutable: false
; CHECK-NEXT: InitExpr:
; CHECK-NEXT: Opcode: I32_CONST
diff --git a/llvm/test/MC/WebAssembly/explicit-sections.ll b/llvm/test/MC/WebAssembly/explicit-sections.ll
index 87a2c6bcf03..91f2f7bd28c 100644
--- a/llvm/test/MC/WebAssembly/explicit-sections.ll
+++ b/llvm/test/MC/WebAssembly/explicit-sections.ll
@@ -9,22 +9,26 @@
; CHECK: - Type: GLOBAL
; CHECK-NEXT: Globals:
-; CHECK-NEXT: - Type: I32
+; CHECK-NEXT: - Index: 0
+; CHECK-NEXT: Type: I32
; CHECK-NEXT: Mutable: false
; CHECK-NEXT: InitExpr:
; CHECK-NEXT: Opcode: I32_CONST
; CHECK-NEXT: Value: 0
-; CHECK-NEXT: - Type: I32
+; CHECK-NEXT: - Index: 1
+; CHECK-NEXT: Type: I32
; CHECK-NEXT: Mutable: false
; CHECK-NEXT: InitExpr:
; CHECK-NEXT: Opcode: I32_CONST
; CHECK-NEXT: Value: 8
-; CHECK-NEXT: - Type: I32
+; CHECK-NEXT: - Index: 2
+; CHECK-NEXT: Type: I32
; CHECK-NEXT: Mutable: false
; CHECK-NEXT: InitExpr:
; CHECK-NEXT: Opcode: I32_CONST
; CHECK-NEXT: Value: 16
-; CHECK-NEXT: - Type: I32
+; CHECK-NEXT: - Index: 3
+; CHECK-NEXT: Type: I32
; CHECK-NEXT: Mutable: false
; CHECK-NEXT: InitExpr:
; CHECK-NEXT: Opcode: I32_CONST
diff --git a/llvm/test/MC/WebAssembly/init-fini-array.ll b/llvm/test/MC/WebAssembly/init-fini-array.ll
index ddcdd1a0c41..b0a0d4b3555 100644
--- a/llvm/test/MC/WebAssembly/init-fini-array.ll
+++ b/llvm/test/MC/WebAssembly/init-fini-array.ll
@@ -55,7 +55,8 @@ declare void @func3()
; CHECK-NEXT: FunctionTypes: [ 0, 1, 0, 1 ]
; CHECK-NEXT: - Type: GLOBAL
; CHECK-NEXT: Globals:
-; CHECK-NEXT: - Type: I32
+; CHECK-NEXT: - Index: 1
+; CHECK-NEXT: Type: I32
; CHECK-NEXT: Mutable: false
; CHECK-NEXT: InitExpr:
; CHECK-NEXT: Opcode: I32_CONST
@@ -110,13 +111,17 @@ declare void @func3()
; CHECK-NEXT: Index: 1
; CHECK-NEXT: Offset: 0x00000045
; CHECK-NEXT: Functions:
-; CHECK-NEXT: - Locals:
+; CHECK-NEXT: - Index: 5
+; CHECK-NEXT: Locals:
; CHECK-NEXT: Body: 1080808080000B
-; CHECK-NEXT: - Locals:
+; CHECK-NEXT: - Index: 6
+; CHECK-NEXT: Locals:
; CHECK-NEXT: Body: 0240418080808000410041FFFFFFFF7F1081808080000D000F0B00000B
-; CHECK-NEXT: - Locals:
+; CHECK-NEXT: - Index: 7
+; CHECK-NEXT: Locals:
; CHECK-NEXT: Body: 1082808080000B
-; CHECK-NEXT: - Locals:
+; CHECK-NEXT: - Index: 8
+; CHECK-NEXT: Locals:
; CHECK-NEXT: Body: 0240418180808000410041FFFFFFFF7F1081808080000D000F0B00000B
; CHECK-NEXT: - Type: DATA
; CHECK-NEXT: Segments:
diff --git a/llvm/test/MC/WebAssembly/unnamed-data.ll b/llvm/test/MC/WebAssembly/unnamed-data.ll
index 98e7a81c196..27d4a587fba 100644
--- a/llvm/test/MC/WebAssembly/unnamed-data.ll
+++ b/llvm/test/MC/WebAssembly/unnamed-data.ll
@@ -9,22 +9,26 @@
; CHECK: - Type: GLOBAL
; CHECK-NEXT: Globals:
-; CHECK-NEXT: - Type: I32
+; CHECK-NEXT: - Index: 0
+; CHECK-NEXT: Type: I32
; CHECK-NEXT: Mutable: false
; CHECK-NEXT: InitExpr:
; CHECK-NEXT: Opcode: I32_CONST
; CHECK-NEXT: Value: 0
-; CHECK-NEXT: - Type: I32
+; CHECK-NEXT: - Index: 1
+; CHECK-NEXT: Type: I32
; CHECK-NEXT: Mutable: false
; CHECK-NEXT: InitExpr:
; CHECK-NEXT: Opcode: I32_CONST
; CHECK-NEXT: Value: 6
-; CHECK-NEXT: - Type: I32
+; CHECK-NEXT: - Index: 2
+; CHECK-NEXT: Type: I32
; CHECK-NEXT: Mutable: false
; CHECK-NEXT: InitExpr:
; CHECK-NEXT: Opcode: I32_CONST
; CHECK-NEXT: Value: 16
-; CHECK-NEXT: - Type: I32
+; CHECK-NEXT: - Index: 3
+; CHECK-NEXT: Type: I32
; CHECK-NEXT: Mutable: false
; CHECK-NEXT: InitExpr:
; CHECK-NEXT: Opcode: I32_CONST
diff --git a/llvm/test/MC/WebAssembly/weak-alias.ll b/llvm/test/MC/WebAssembly/weak-alias.ll
index 29eeac02da6..83757f48a16 100644
--- a/llvm/test/MC/WebAssembly/weak-alias.ll
+++ b/llvm/test/MC/WebAssembly/weak-alias.ll
@@ -76,17 +76,20 @@ entry:
; CHECK-NEXT: FunctionTypes: [ 0, 0, 0, 0, 0 ]
; CHECK-NEXT: - Type: GLOBAL
; CHECK-NEXT: Globals:
-; CHECK-NEXT: - Type: I32
+; CHECK-NEXT: - Index: 1
+; CHECK-NEXT: Type: I32
; CHECK-NEXT: Mutable: false
; CHECK-NEXT: InitExpr:
; CHECK-NEXT: Opcode: I32_CONST
; CHECK-NEXT: Value: 8
-; CHECK-NEXT: - Type: I32
+; CHECK-NEXT: - Index: 2
+; CHECK-NEXT: Type: I32
; CHECK-NEXT: Mutable: false
; CHECK-NEXT: InitExpr:
; CHECK-NEXT: Opcode: I32_CONST
; CHECK-NEXT: Value: 16
-; CHECK-NEXT: - Type: I32
+; CHECK-NEXT: - Index: 3
+; CHECK-NEXT: Type: I32
; CHECK-NEXT: Mutable: false
; CHECK-NEXT: InitExpr:
; CHECK-NEXT: Opcode: I32_CONST
@@ -150,15 +153,20 @@ entry:
; CHECK-NEXT: Index: 0
; CHECK-NEXT: Offset: 0x00000037
; CHECK-NEXT: Functions:
-; CHECK-NEXT: - Locals:
+; CHECK-NEXT: - Index: 1
+; CHECK-NEXT: Locals:
; CHECK-NEXT: Body: 41000B
-; CHECK-NEXT: - Locals:
+; CHECK-NEXT: - Index: 2
+; CHECK-NEXT: Locals:
; CHECK-NEXT: Body: 1081808080000B
-; CHECK-NEXT: - Locals:
+; CHECK-NEXT: - Index: 3
+; CHECK-NEXT: Locals:
; CHECK-NEXT: Body: 1080808080000B
-; CHECK-NEXT: - Locals:
+; CHECK-NEXT: - Index: 4
+; CHECK-NEXT: Locals:
; CHECK-NEXT: Body: 410028028880808000118080808000000B
-; CHECK-NEXT: - Locals:
+; CHECK-NEXT: - Index: 5
+; CHECK-NEXT: Locals:
; CHECK-NEXT: Body: 410028029080808000118080808000000B
; CHECK-NEXT: - Type: DATA
; CHECK-NEXT: Relocations:
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
diff --git a/llvm/test/tools/llvm-nm/wasm/exports.yaml b/llvm/test/tools/llvm-nm/wasm/exports.yaml
index ad31fea774c..c9937747a68 100644
--- a/llvm/test/tools/llvm-nm/wasm/exports.yaml
+++ b/llvm/test/tools/llvm-nm/wasm/exports.yaml
@@ -9,39 +9,43 @@ FileHeader:
Sections:
- Type: TYPE
Signatures:
- - ReturnType: I32
+ - Index: 0
+ ReturnType: I32
ParamTypes:
- I32
+ - Type: IMPORT
+ Imports:
+ - Module: env
+ Field: fimport
+ Kind: FUNCTION
+ SigIndex: 0
+ - Module: env
+ Field: gimport
+ Kind: GLOBAL
+ GlobalType: I32
+ GlobalMutable: false
- Type: FUNCTION
FunctionTypes: [ 0, 0, 0, 0, 0 ]
- Type: GLOBAL
Globals:
- - Type: I32
+ - Index: 1
+ Type: I32
Mutable: false
InitExpr:
Opcode: I64_CONST
Value: 32
- - Type: I32
+ - Index: 2
+ Type: I32
Mutable: false
InitExpr:
Opcode: I32_CONST
Value: 64
- - Type: I32
+ - Index: 3
+ Type: I32
Mutable: false
InitExpr:
Opcode: I32_CONST
Value: 1024
- - Type: IMPORT
- Imports:
- - Module: env
- Field: fimport
- Kind: FUNCTION
- SigIndex: 0
- - Module: env
- Field: gimport
- Kind: GLOBAL
- GlobalType: I32
- GlobalMutable: false
- Type: EXPORT
Exports:
- Name: foo
diff --git a/llvm/test/tools/llvm-nm/wasm/imports.yaml b/llvm/test/tools/llvm-nm/wasm/imports.yaml
index 82be0a675b0..2f25d7ff95b 100644
--- a/llvm/test/tools/llvm-nm/wasm/imports.yaml
+++ b/llvm/test/tools/llvm-nm/wasm/imports.yaml
@@ -6,7 +6,8 @@ FileHeader:
Sections:
- Type: TYPE
Signatures:
- - ReturnType: I32
+ - Index: 0
+ ReturnType: I32
ParamTypes:
- I32
- Type: IMPORT
diff --git a/llvm/test/tools/llvm-nm/wasm/weak-symbols.yaml b/llvm/test/tools/llvm-nm/wasm/weak-symbols.yaml
index 254fb4ddf68..816634f616c 100644
--- a/llvm/test/tools/llvm-nm/wasm/weak-symbols.yaml
+++ b/llvm/test/tools/llvm-nm/wasm/weak-symbols.yaml
@@ -9,11 +9,10 @@ FileHeader:
Sections:
- Type: TYPE
Signatures:
- - ReturnType: I32
+ - Index: 0
+ ReturnType: I32
ParamTypes:
- I32
- - Type: FUNCTION
- FunctionTypes: [ 0, 0, 0, 0 ]
- Type: IMPORT
Imports:
- Module: env
@@ -25,19 +24,24 @@ Sections:
Kind: GLOBAL
GlobalType: I32
GlobalMutable: false
+ - Type: FUNCTION
+ FunctionTypes: [ 0, 0, 0, 0 ]
- Type: GLOBAL
Globals:
- - Type: I32
+ - Index: 1
+ Type: I32
Mutable: false
InitExpr:
Opcode: I64_CONST
Value: 32
- - Type: I32
+ - Index: 2
+ Type: I32
Mutable: false
InitExpr:
Opcode: I32_CONST
Value: 64
- - Type: I32
+ - Index: 3
+ Type: I32
Mutable: false
InitExpr:
Opcode: I32_CONST
OpenPOWER on IntegriCloud