brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · c166298 Raw
61 lines · plain
1# Test in default mode2# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s3# RUN: not wasm-ld --export=missing -o %t.wasm %t.o 2>&1 | FileCheck -check-prefix=CHECK-ERROR %s4# RUN: wasm-ld --export=hidden_function -o %t.wasm %t.o5# RUN: obj2yaml %t.wasm | FileCheck %s6 7# Now test in Emscripten mode8# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-emscripten -o %t.o %s9# RUN: not wasm-ld --export=missing -o %t.wasm %t.o 2>&1 | FileCheck -check-prefix=CHECK-ERROR %s10# RUN: wasm-ld --export=hidden_function -o %t.wasm %t.o11# RUN: obj2yaml %t.wasm | FileCheck %s --check-prefixes=CHECK,EMSCRIPTEN12 13# Not exported by default, but forced via commandline14  .hidden hidden_function15  .globl hidden_function16hidden_function:17  .functype hidden_function () -> (i32)18  i32.const 019  end_function20 21# Not exported by default22  .globl default_function23default_function:24  .functype default_function () -> (i32)25  i32.const 026  end_function27 28# Exported in emscripten mode which treats .no_dead_strip as a signal to export29  .no_dead_strip used_function30  .globl used_function31used_function:32  .functype used_function () -> (i32)33  i32.const 034  end_function35 36# Exported by default37.globl _start38_start:39  .functype _start () -> ()40  end_function41 42# CHECK-ERROR: error: symbol exported via --export not found: missing43 44# CHECK-NOT: - Name: default_function45 46# CHECK:        - Type:            EXPORT47# CHECK-NEXT:     Exports:48# CHECK-NEXT:       - Name:            memory49# CHECK-NEXT:         Kind:            MEMORY50# CHECK-NEXT:         Index:           051# CHECK-NEXT:       - Name:            hidden_function52# CHECK-NEXT:         Kind:            FUNCTION53# CHECK-NEXT:         Index:           054# EMSCRIPTEN-NEXT:  - Name:            used_function55# EMSCRIPTEN-NEXT:    Kind:            FUNCTION56# EMSCRIPTEN-NEXT:    Index:           157# CHECK-NEXT:       - Name:            _start58# CHECK-NEXT:         Kind:            FUNCTION59# CHECK-NEXT:         Index:           260# CHECK-NEXT:   - Type:            CODE61