mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-25 04:35:32 -04:00
9dcce983ad
Summary: This ensures that object files will continue to validate as WebAssembly modules in the presence of bulk memory operations. Engines that don't support bulk memory operations will not recognize the DataCount section and will report validation errors, but that's ok because object files aren't supposed to be run directly anyway. Reviewers: aheejin, dschuff, sbc100 Subscribers: jgravelle-google, hiraditya, sunfish, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60623 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358315 91177308-0d34-0410-b5e6-96231b3b80d8
31 lines
1.1 KiB
LLVM
31 lines
1.1 KiB
LLVM
; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
|
|
|
|
target triple = "wasm32-unknown-unknown"
|
|
|
|
; Verify relocations are correctly generated for addresses of externals
|
|
; in the data section.
|
|
|
|
@myimport = external global i32, align 4
|
|
|
|
@foo = global i64 7, align 4
|
|
@bar = hidden global i32* @myimport, align 4
|
|
|
|
; CHECK: - Type: DATA{{$}}
|
|
; CHECK-NEXT: Relocations:
|
|
; CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_I32
|
|
; CHECK-NEXT: Index: 2
|
|
; CHECK-NEXT: Offset: 0x00000013
|
|
; CHECK-NEXT: Segments:
|
|
; CHECK-NEXT: - SectionOffset: 6
|
|
; CHECK-NEXT: InitFlags: 0
|
|
; CHECK-NEXT: Offset:
|
|
; CHECK-NEXT: Opcode: I32_CONST
|
|
; CHECK-NEXT: Value: 0
|
|
; CHECK-NEXT: Content: '0700000000000000'
|
|
; CHECK-NEXT: - SectionOffset: 19
|
|
; CHECK-NEXT: InitFlags: 0
|
|
; CHECK-NEXT: Offset:
|
|
; CHECK-NEXT: Opcode: I32_CONST
|
|
; CHECK-NEXT: Value: 8
|
|
; CHECK-NEXT: Content: '00000000'
|