[LLD][COFF] Ignore DEBUG_S_XFGHASH_TYPE/VIRTUAL
[llvm-project.git] / lld / test / wasm / gc-imports.s
blob4e6053b5caf2c08c58ec521973538d9cc07833fd
1 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %s -o %t.o
2 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %S/Inputs/undefined-globals.s -o %t_globals.o
3 # RUN: wasm-ld --allow-undefined -o %t1.wasm %t.o %t_globals.o
5 .functype unused_undef_function (i64) -> (i64)
6 .functype used_undef_function () -> (i32)
7 .functype use_undef_global () -> (i64)
9 foo:
10 .functype foo (i64) -> (i64)
11 local.get 0
12 call unused_undef_function
13 end_function
15 .globl _start
17 _start:
18 .functype _start () -> ()
19 call used_undef_function
20 drop
21 call use_undef_global
22 drop
23 end_function
25 # RUN: obj2yaml %t1.wasm | FileCheck %s
27 # CHECK: - Type: IMPORT
28 # CHECK-NEXT: Imports:
29 # CHECK-NEXT: - Module: env
30 # CHECK-NEXT: Field: used_undef_function
31 # CHECK-NEXT: Kind: FUNCTION
32 # CHECK-NEXT: SigIndex: 0
33 # CHECK-NEXT: - Module: env
34 # CHECK-NEXT: Field: used_undef_global
35 # CHECK-NEXT: Kind: GLOBAL
36 # CHECK-NEXT: GlobalType: I64
37 # CHECK-NEXT: GlobalMutable: false
38 # CHECK-NEXT: - Type:
39 # CHECK: - Type: CUSTOM
40 # CHECK-NEXT: Name: name
41 # CHECK-NEXT: FunctionNames:
42 # CHECK-NEXT: - Index: 0
43 # CHECK-NEXT: Name: used_undef_function
44 # CHECK-NEXT: - Index: 1
45 # CHECK-NEXT: Name: _start
46 # CHECK-NEXT: - Index: 2
47 # CHECK-NEXT: Name: use_undef_global
48 # CHECK-NEXT: GlobalNames:
49 # CHECK-NEXT: - Index: 0
50 # CHECK-NEXT: Name: used_undef_global
51 # CHECK-NEXT: - Index: 1
52 # CHECK-NEXT: Name: __stack_pointer
53 # CHECK-NEXT: ...
55 # RUN: wasm-ld --no-gc-sections --allow-undefined \
56 # RUN: -o %t1.no-gc.wasm %t.o %t_globals.o
57 # RUN: obj2yaml %t1.no-gc.wasm | FileCheck %s -check-prefix=NO-GC
59 # NO-GC: - Type: IMPORT
60 # NO-GC-NEXT: Imports:
61 # NO-GC-NEXT: - Module: env
62 # NO-GC-NEXT: Field: unused_undef_function
63 # NO-GC-NEXT: Kind: FUNCTION
64 # NO-GC-NEXT: SigIndex: 0
65 # NO-GC-NEXT: - Module: env
66 # NO-GC-NEXT: Field: used_undef_function
67 # NO-GC-NEXT: Kind: FUNCTION
68 # NO-GC-NEXT: SigIndex: 1
69 # NO-GC-NEXT: - Module: env
70 # NO-GC-NEXT: Field: unused_undef_global
71 # NO-GC-NEXT: Kind: GLOBAL
72 # NO-GC-NEXT: GlobalType: I64
73 # NO-GC-NEXT: GlobalMutable: false
74 # NO-GC-NEXT: - Module: env
75 # NO-GC-NEXT: Field: used_undef_global
76 # NO-GC-NEXT: Kind: GLOBAL
77 # NO-GC-NEXT: GlobalType: I64
78 # NO-GC-NEXT: GlobalMutable: false
79 # NO-GC-NEXT: - Type:
80 # NO-GC: - Type: CUSTOM
81 # NO-GC-NEXT: Name: name
82 # NO-GC-NEXT: FunctionNames:
83 # NO-GC-NEXT: - Index: 0
84 # NO-GC-NEXT: Name: unused_undef_function
85 # NO-GC-NEXT: - Index: 1
86 # NO-GC-NEXT: Name: used_undef_function
87 # NO-GC-NEXT: - Index: 2
88 # NO-GC-NEXT: Name: __wasm_call_ctors
89 # NO-GC-NEXT: - Index: 3
90 # NO-GC-NEXT: Name: foo
91 # NO-GC-NEXT: - Index: 4
92 # NO-GC-NEXT: Name: _start
93 # NO-GC-NEXT: - Index: 5
94 # NO-GC-NEXT: Name: use_undef_global
95 # NO-GC-NEXT: GlobalNames:
96 # NO-GC-NEXT: - Index: 0
97 # NO-GC-NEXT: Name: unused_undef_global
98 # NO-GC-NEXT: - Index: 1
99 # NO-GC-NEXT: Name: used_undef_global
100 # NO-GC-NEXT: - Index: 2
101 # NO-GC-NEXT: Name: __stack_pointer
102 # NO-GC-NEXT: ...