xref: /llvm-project-15.0.7/lld/test/wasm/export-optional.s (revision 9647a6f7)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Test the --export of optional linker-synthetic symbols works.
2# Specifically the __start_xxx and __end_xx symbols.
3
4# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %s -o %t.o
5# RUN: wasm-ld --export=__start_foo %t.o -o %t.wasm
6# RUN: obj2yaml %t.wasm | FileCheck %s
7
8  .globl  _start
9_start:
10  .functype _start () -> ()
11  i32.const 0
12  i32.load foo
13  drop
14  end_function
15
16  .globl  foo
17  .section    foo,"",@
18foo:
19  .int32 42
20  .size foo, 4
21
22#      CHECK:  - Type:            EXPORT
23# CHECK-NEXT:    Exports:
24# CHECK-NEXT:      - Name:            memory
25# CHECK-NEXT:        Kind:            MEMORY
26# CHECK-NEXT:        Index:           0
27# CHECK-NEXT:      - Name:            _start
28# CHECK-NEXT:        Kind:            FUNCTION
29# CHECK-NEXT:        Index:           0
30# CHECK-NEXT:      - Name:            __start_foo
31# CHECK-NEXT:        Kind:            GLOBAL
32# CHECK-NEXT:        Index:           1
33

served by {OpenGrok

Last Index Update: Tue Oct 21 18:42:31 GMT 2025