summaryrefslogtreecommitdiffstats
path: root/llvm/test/ObjectYAML/wasm
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2017-04-26 00:02:31 +0000
committerSam Clegg <sbc@chromium.org>2017-04-26 00:02:31 +0000
commitcc182aaaef21864df857d0bf3e9844a0db8d2403 (patch)
treefec0fb85d52fba64410a70516d2eb2df5e9fdcb1 /llvm/test/ObjectYAML/wasm
parentff49a055655c78704ee8ddf912f14162142e7bc0 (diff)
downloadbcm5719-llvm-cc182aaaef21864df857d0bf3e9844a0db8d2403.tar.gz
bcm5719-llvm-cc182aaaef21864df857d0bf3e9844a0db8d2403.zip
[WebAssembly] Allow for signed relocation addends
Summary: Addends are used as offsets to addresses of globals and can be both positive and negative. This change prints libObject in line with the spec and the MC layer. Subscribers: jfb, dschuff Differential Revision: https://reviews.llvm.org/D32507 llvm-svn: 301369
Diffstat (limited to 'llvm/test/ObjectYAML/wasm')
-rw-r--r--llvm/test/ObjectYAML/wasm/code_section.yaml4
-rw-r--r--llvm/test/ObjectYAML/wasm/data_section.yaml32
2 files changed, 25 insertions, 11 deletions
diff --git a/llvm/test/ObjectYAML/wasm/code_section.yaml b/llvm/test/ObjectYAML/wasm/code_section.yaml
index b75bf7e1cfd..5359d2a100c 100644
--- a/llvm/test/ObjectYAML/wasm/code_section.yaml
+++ b/llvm/test/ObjectYAML/wasm/code_section.yaml
@@ -21,11 +21,9 @@ Sections:
- Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB
Index: 0
Offset: 0x00000006
- Addend: 0x00000000
- Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB
Index: 1
Offset: 0x00000025
- Addend: 0x00000000
Functions:
- Locals:
- Type: I32
@@ -56,11 +54,9 @@ Sections:
# CHECK: - Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB
# CHECK: Index: 0
# CHECK: Offset: 0x00000006
-# CHECK: Addend: 0x00000000
# CHECK: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB
# CHECK: Index: 1
# CHECK: Offset: 0x00000025
-# CHECK: Addend: 0x00000000
# CHECK: Functions:
# CHECK: - Locals:
# CHECK: - Type: I32
diff --git a/llvm/test/ObjectYAML/wasm/data_section.yaml b/llvm/test/ObjectYAML/wasm/data_section.yaml
index 542d0efe42f..b8c65abbff9 100644
--- a/llvm/test/ObjectYAML/wasm/data_section.yaml
+++ b/llvm/test/ObjectYAML/wasm/data_section.yaml
@@ -13,16 +13,34 @@ Sections:
Opcode: I32_CONST
Value: 4
Content: '10001000'
+ Relocations:
+ - Type: R_WEBASSEMBLY_GLOBAL_ADDR_I32
+ Index: 0
+ Offset: 0x00000006
+ Addend: 8
+ - Type: R_WEBASSEMBLY_GLOBAL_ADDR_I32
+ Index: 0
+ Offset: 0x00000006
+ Addend: -6
...
# CHECK: --- !WASM
# CHECK: FileHeader:
# CHECK: Version: 0x00000001
# CHECK: Sections:
# CHECK: - Type: DATA
-# CHECK: Segments:
-# CHECK: - Index: 0
-# CHECK: Offset:
-# CHECK: Opcode: I32_CONST
-# CHECK: Value: 4
-# CHECK: Content: '10001000'
-# CHECK: ...
+# CHECK-NEXT: Relocations:
+# CHECK-NEXT: - Type: R_WEBASSEMBLY_GLOBAL_ADDR_I32
+# CHECK-NEXT: Index: 0
+# CHECK-NEXT: Offset: 0x00000006
+# CHECK-NEXT: Addend: 8
+# CHECK-NEXT: - Type: R_WEBASSEMBLY_GLOBAL_ADDR_I32
+# CHECK-NEXT: Index: 0
+# CHECK-NEXT: Offset: 0x00000006
+# CHECK-NEXT: Addend: -6
+# CHECK-NEXT: Segments:
+# CHECK-NEXT: - Index: 0
+# CHECK-NEXT: Offset:
+# CHECK-NEXT: Opcode: I32_CONST
+# CHECK-NEXT: Value: 4
+# CHECK-NEXT: Content: '10001000'
+# CHECK-NEXT: ...
OpenPOWER on IntegriCloud