mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-04 12:15:46 +00:00
66bfbedbdf
Zero-length strings are valid export names in WebAssembly, so allow users to specify them. Differential Revision: https://reviews.llvm.org/D71793
38 lines
965 B
LLVM
38 lines
965 B
LLVM
; RUN: llc -filetype=obj %s -o %t.o
|
|
; RUN: wasm-ld -o %t.wasm %t.o
|
|
; RUN: obj2yaml %t.wasm | FileCheck %s
|
|
|
|
target triple = "wasm32-unknown-unknown"
|
|
|
|
define void @foo() #0 {
|
|
ret void
|
|
}
|
|
|
|
define void @qux() #1 {
|
|
ret void
|
|
}
|
|
|
|
define void @_start() {
|
|
call void @foo()
|
|
ret void
|
|
}
|
|
|
|
attributes #0 = { "wasm-export-name"="bar" }
|
|
|
|
attributes #1 = { "wasm-export-name"="" }
|
|
|
|
; CHECK: - Type: EXPORT
|
|
; CHECK-NEXT: Exports:
|
|
; CHECK-NEXT: - Name: memory
|
|
; CHECK-NEXT: Kind: MEMORY
|
|
; CHECK-NEXT: Index: 0
|
|
; CHECK-NEXT: - Name: bar
|
|
; CHECK-NEXT: Kind: FUNCTION
|
|
; CHECK-NEXT: Index: 0
|
|
; CHECK-NEXT: - Name: ''
|
|
; CHECK-NEXT: Kind: FUNCTION
|
|
; CHECK-NEXT: Index: 1
|
|
; CHECK-NEXT: - Name: _start
|
|
; CHECK-NEXT: Kind: FUNCTION
|
|
; CHECK-NEXT: Index: 2
|