[AArch64][SME2] Add multi-vector saturating doubling multiply high intrinsics
[llvm-project.git] / lld / test / wasm / undefined-weak-call.s
blob7490104afe516838ff207433f3b017ea2463568b
1 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s
2 # RUN: wasm-ld --entry=callWeakFuncs --print-gc-sections %t.o \
3 # RUN: -o %t.wasm 2>&1 | FileCheck -check-prefix=CHECK-GC %s
4 # RUN: obj2yaml %t.wasm | FileCheck %s
7 # Check that calling an undefined weak function generates an appropriate stub
8 # that will fail at runtime with "unreachable".
10 .functype weakFunc1 () -> ()
11 .functype weakFunc2 () -> ()
12 .functype weakFunc3 (i32) -> ()
13 .functype weakFunc4 () -> ()
15 .globl callWeakFuncs
17 callWeakFuncs:
18 .functype callWeakFuncs () -> (i32)
19 call weakFunc1
20 call weakFunc2
21 i32.const 2
22 call weakFunc3
23 i32.const weakFunc1
24 i32.const weakFunc4
25 i32.add
26 end_function
28 .weak weakFunc1
29 .weak weakFunc2
30 .weak weakFunc3
31 .weak weakFunc4
33 # CHECK-GC: removing unused section {{.*}}:(weakFunc4)
35 # CHECK: --- !WASM
36 # CHECK-NEXT: FileHeader:
37 # CHECK-NEXT: Version: 0x1
38 # CHECK-NEXT: Sections:
39 # CHECK-NEXT: - Type: TYPE
40 # CHECK-NEXT: Signatures:
41 # CHECK-NEXT: - Index: 0
42 # CHECK-NEXT: ParamTypes:
43 # CHECK-NEXT: ReturnTypes: []
44 # CHECK-NEXT: - Index: 1
45 # CHECK-NEXT: ParamTypes:
46 # CHECK-NEXT: - I32
47 # CHECK-NEXT: ReturnTypes: []
48 # CHECK-NEXT: - Index: 2
49 # CHECK-NEXT: ParamTypes:
50 # CHECK-NEXT: ReturnTypes:
51 # CHECK-NEXT: - I32
52 # CHECK-NEXT: - Type: FUNCTION
53 # CHECK-NEXT: FunctionTypes: [ 0, 0, 1, 2 ]
54 # CHECK-NEXT: - Type: TABLE
55 # CHECK-NEXT: Tables:
56 # CHECK-NEXT: - Index: 0
57 # CHECK-NEXT: ElemType: FUNCREF
58 # CHECK-NEXT: Limits:
59 # CHECK-NEXT: Flags: [ HAS_MAX ]
60 # CHECK-NEXT: Minimum: 0x1
61 # CHECK-NEXT: Maximum: 0x1
62 # CHECK-NEXT: - Type: MEMORY
63 # CHECK-NEXT: Memories:
64 # CHECK-NEXT: - Minimum: 0x2
65 # CHECK-NEXT: - Type: GLOBAL
66 # CHECK-NEXT: Globals:
67 # CHECK-NEXT: - Index: 0
68 # CHECK-NEXT: Type: I32
69 # CHECK-NEXT: Mutable: true
70 # CHECK-NEXT: InitExpr:
71 # CHECK-NEXT: Opcode: I32_CONST
72 # CHECK-NEXT: Value: 66560
73 # CHECK-NEXT: - Type: EXPORT
74 # CHECK-NEXT: Exports:
75 # CHECK-NEXT: - Name: memory
76 # CHECK-NEXT: Kind: MEMORY
77 # CHECK-NEXT: Index: 0
78 # CHECK-NEXT: - Name: callWeakFuncs
79 # CHECK-NEXT: Kind: FUNCTION
80 # CHECK-NEXT: Index: 3
81 # CHECK-NEXT: - Type: CODE
82 # CHECK-NEXT: Functions:
83 # CHECK-NEXT: - Index: 0
84 # CHECK-NEXT: Locals:
85 # CHECK-NEXT: Body: 000B
86 # CHECK-NEXT: - Index: 1
87 # CHECK-NEXT: Locals:
88 # CHECK-NEXT: Body: 000B
89 # CHECK-NEXT: - Index: 2
90 # CHECK-NEXT: Locals:
91 # CHECK-NEXT: Body: 000B
92 # CHECK-NEXT: - Index: 3
93 # CHECK-NEXT: Locals:
94 # CHECK-NEXT: Body: 10808080800010818080800041021082808080004180808080004180808080006A0B
95 # CHECK-NEXT: - Type: CUSTOM
96 # CHECK-NEXT: Name: name
97 # CHECK-NEXT: FunctionNames:
98 # CHECK-NEXT: - Index: 0
99 # CHECK-NEXT: Name: 'undefined_weak:weakFunc1'
100 # CHECK-NEXT: - Index: 1
101 # CHECK-NEXT: Name: 'undefined_weak:weakFunc2'
102 # CHECK-NEXT: - Index: 2
103 # CHECK-NEXT: Name: 'undefined_weak:weakFunc3'
104 # CHECK-NEXT: - Index: 3
105 # CHECK-NEXT: Name: callWeakFuncs
106 # CHECK-NEXT: GlobalNames:
107 # CHECK-NEXT: - Index: 0
108 # CHECK-NEXT: Name: __stack_pointer
109 # CHECK-NEXT: ...