llvm-project
28 строк · 816.0 Байт
1; RUN: llc -filetype=obj %s -o %t.o
2; RUN: wasm-ld --allow-undefined -o %t.wasm %t.o
3; RUN: obj2yaml %t.wasm | FileCheck %s
4
5target triple = "wasm32-unknown-unknown-wasm"
6
7define void @_start() {
8call void @foo();
9call void @qux();
10ret void
11}
12
13declare void @foo() #0
14declare void @qux() #1
15
16attributes #0 = { "wasm-import-module"="bar" }
17attributes #1 = { "wasm-import-module"="" }
18
19; CHECK: - Type: IMPORT
20; CHECK-NEXT: Imports:
21; CHECK-NEXT: - Module: bar
22; CHECK-NEXT: Field: foo
23; CHECK-NEXT: Kind: FUNCTION
24; CHECK-NEXT: SigIndex: 0
25; CHECK-NEXT: - Module: ''
26; CHECK-NEXT: Field: qux
27; CHECK-NEXT: Kind: FUNCTION
28; CHECK-NEXT: SigIndex: 0
29