llvm-project
37 строк · 965.0 Байт
1; RUN: llc -filetype=obj %s -o %t.o
2; RUN: wasm-ld -o %t.wasm %t.o
3; RUN: obj2yaml %t.wasm | FileCheck %s
4
5target triple = "wasm32-unknown-unknown"
6
7define void @foo() #0 {
8ret void
9}
10
11define void @qux() #1 {
12ret void
13}
14
15define void @_start() {
16call void @foo()
17ret void
18}
19
20attributes #0 = { "wasm-export-name"="bar" }
21
22attributes #1 = { "wasm-export-name"="" }
23
24; CHECK: - Type: EXPORT
25; CHECK-NEXT: Exports:
26; CHECK-NEXT: - Name: memory
27; CHECK-NEXT: Kind: MEMORY
28; CHECK-NEXT: Index: 0
29; CHECK-NEXT: - Name: bar
30; CHECK-NEXT: Kind: FUNCTION
31; CHECK-NEXT: Index: 0
32; CHECK-NEXT: - Name: ''
33; CHECK-NEXT: Kind: FUNCTION
34; CHECK-NEXT: Index: 1
35; CHECK-NEXT: - Name: _start
36; CHECK-NEXT: Kind: FUNCTION
37; CHECK-NEXT: Index: 2
38