1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/test/MC/WebAssembly/no-dead-strip.ll
Dan Gohman f73e4af6a5 [WebAssembly] Make __attribute__((used)) not imply export.
Add an WASM_SYMBOL_NO_STRIP flag, so that __attribute__((used)) doesn't
need to imply exporting. When targeting Emscripten, have
WASM_SYMBOL_NO_STRIP imply exporting.

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

llvm-svn: 370415
2019-08-29 22:40:00 +00:00

22 lines
558 B
LLVM

; RUN: llc -filetype=obj -wasm-keep-registers %s -o - | llvm-readobj --symbols | FileCheck %s
target triple = "wasm32-unknown-unknown"
@llvm.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @foo to i8*)], section "llvm.metadata"
define i32 @foo() {
entry:
ret i32 0
}
; CHECK: Symbols [
; CHECK-NEXT: Symbol {
; CHECK-NEXT: Name: foo
; CHECK-NEXT: Type: FUNCTION (0x0)
; CHECK-NEXT: Flags [ (0x80)
; CHECK-NEXT: NO_STRIP (0x80)
; CHECK-NEXT: ]
; CHECK-NEXT: ElementIndex: 0x0
; CHECK-NEXT: }
; CHECK-NEXT: ]