1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 13:11:39 +01:00
llvm-mirror/test/MC/WebAssembly/event-section.ll
Sam Clegg d8d06a1305 [WebAssembly] Rename relocations from R_WEBASSEMBLY_ to R_WASM_
See https://github.com/WebAssembly/tool-conventions/pull/95.

This is less typing and IMHO more readable, and it also fits with
our naming around the binary format which tends to use the short name.
e.g.

include/llvm/BinaryFormat/Wasm.h
tools/llvm-objdump/WasmDump.cpp
etc..

Differential Revision: https://reviews.llvm.org/D57611

llvm-svn: 353062
2019-02-04 17:28:46 +00:00

59 lines
1.9 KiB
LLVM

; RUN: llc -filetype=obj -exception-model=wasm -mattr=+exception-handling %s -o - | obj2yaml | FileCheck %s
; RUN: llc -filetype=obj -exception-model=wasm -mattr=+exception-handling %s -o - | llvm-readobj -s | FileCheck -check-prefix=SEC %s
target triple = "wasm32-unknown-unknown"
declare void @llvm.wasm.throw(i32, i8*)
define i32 @test_throw0(i8* %p) {
call void @llvm.wasm.throw(i32 0, i8* %p)
ret i32 0
}
define i32 @test_throw1(i8* %p) {
call void @llvm.wasm.throw(i32 0, i8* %p)
ret i32 1
}
; CHECK: Sections:
; CHECK-NEXT: - Type: TYPE
; CHECK-NEXT: Signatures:
; CHECK-NEXT: - Index: 0
; CHECK-NEXT: ReturnType: I32
; CHECK-NEXT: ParamTypes:
; CHECK-NEXT: - I32
; CHECK-NEXT: - Index: 1
; CHECK-NEXT: ReturnType: NORESULT
; CHECK-NEXT: ParamTypes:
; CHECK-NEXT: - I32
; CHECK: - Type: EVENT
; CHECK-NEXT: Events:
; CHECK-NEXT: - Index: 0
; CHECK-NEXT: Attribute: 0
; CHECK-NEXT: SigIndex: 1
; CHECK-NEXT: - Type: CODE
; CHECK-NEXT: Relocations:
; CHECK-NEXT: - Type: R_WASM_EVENT_INDEX_LEB
; CHECK-NEXT: Index: 1
; CHECK-NEXT: Offset: 0x00000006
; CHECK-NEXT: - Type: R_WASM_EVENT_INDEX_LEB
; CHECK-NEXT: Index: 1
; CHECK-NEXT: Offset: 0x00000011
; CHECK: - Type: CUSTOM
; CHECK-NEXT: Name: linking
; CHECK-NEXT: Version: 2
; CHECK-NEXT: SymbolTable:
; CHECK: - Index: 1
; CHECK-NEXT: Kind: EVENT
; CHECK-NEXT: Name: __cpp_exception
; CHECK-NEXT: Flags: [ BINDING_WEAK ]
; CHECK-NEXT: Event: 0
; SEC: Type: EVENT (0xD)
; SEC-NEXT: Size: 3
; SEC-NEXT: Offset: 97