mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 15:16:09 +00:00

This causes all symbols to be exported in the final wasm binary even if they were not compiled with default visibility. This feature is useful for the emscripten toolchain that has a corresponding EXPORT_ALL feature which allows the JS code to interact with all C function. Differential Revision: https://reviews.llvm.org/D47806 llvm-svn: 334157
46 lines
1.1 KiB
LLVM
46 lines
1.1 KiB
LLVM
; RUN: llc -O0 -filetype=obj %s -o %t.o
|
|
|
|
; RUN: wasm-ld -o %t.wasm %t.o
|
|
; RUN: obj2yaml %t.wasm | FileCheck %s
|
|
|
|
; RUN: wasm-ld --export-all -o %t.wasm %t.o
|
|
; RUN: obj2yaml %t.wasm | FileCheck %s -check-prefix=EXPORT
|
|
|
|
; RUN: wasm-ld --export-all --no-gc-sections -o %t.wasm %t.o
|
|
; RUN: obj2yaml %t.wasm | FileCheck %s -check-prefix=NOGC
|
|
|
|
; Verify the --export-all flag exports hidden symbols
|
|
|
|
target triple = "wasm32-unknown-unknown"
|
|
|
|
define hidden void @bar() local_unnamed_addr {
|
|
entry:
|
|
ret void
|
|
}
|
|
|
|
define hidden void @foo() local_unnamed_addr {
|
|
entry:
|
|
ret void
|
|
}
|
|
|
|
define hidden void @_start() local_unnamed_addr {
|
|
entry:
|
|
call void @foo()
|
|
ret void
|
|
}
|
|
|
|
; CHECK: - Type: EXPORT
|
|
; CHECK: - Name: _start
|
|
; CHECK-NOT: - Name: bar
|
|
; CHECK-NOT: - Name: foo
|
|
|
|
; EXPORT: - Type: EXPORT
|
|
; EXPORT: - Name: _start
|
|
; EXPORT-NOT: - Name: bar
|
|
; EXPORT: - Name: foo
|
|
|
|
; NOGC: - Type: EXPORT
|
|
; NOGC: - Name: _start
|
|
; NOGC: - Name: bar
|
|
; NOGC: - Name: foo
|