@@ -31,7 +31,7 @@ define void @test_fpsig_return_i32(ptr noundef %func) local_unnamed_addr #0 {
3131; CHECK-NEXT: call use
3232; CHECK-NEXT: # fallthrough-return
3333entry:
34- %res = tail call i32 (ptr , ...) @llvm.wasm.ref.test.func (ptr %func , i32 0 )
34+ %res = tail call i32 (ptr , ...) @llvm.wasm.ref.test.func (ptr %func , i32 poison )
3535 tail call void @use (i32 noundef %res ) #3
3636 ret void
3737}
@@ -48,7 +48,7 @@ define void @test_fpsig_return_i64(ptr noundef %func) local_unnamed_addr #0 {
4848; CHECK-NEXT: call use
4949; CHECK-NEXT: # fallthrough-return
5050entry:
51- %res = tail call i32 (ptr , ...) @llvm.wasm.ref.test.func (ptr %func , i64 0 )
51+ %res = tail call i32 (ptr , ...) @llvm.wasm.ref.test.func (ptr %func , i64 poison )
5252 tail call void @use (i32 noundef %res ) #3
5353 ret void
5454}
@@ -65,7 +65,7 @@ define void @test_fpsig_return_f32(ptr noundef %func) local_unnamed_addr #0 {
6565; CHECK-NEXT: call use
6666; CHECK-NEXT: # fallthrough-return
6767entry:
68- %res = tail call i32 (ptr , ...) @llvm.wasm.ref.test.func (ptr %func , float 0 . )
68+ %res = tail call i32 (ptr , ...) @llvm.wasm.ref.test.func (ptr %func , float poison )
6969 tail call void @use (i32 noundef %res ) #3
7070 ret void
7171}
@@ -82,7 +82,7 @@ define void @test_fpsig_return_f64(ptr noundef %func) local_unnamed_addr #0 {
8282; CHECK-NEXT: call use
8383; CHECK-NEXT: # fallthrough-return
8484entry:
85- %res = tail call i32 (ptr , ...) @llvm.wasm.ref.test.func (ptr %func , double 0 . )
85+ %res = tail call i32 (ptr , ...) @llvm.wasm.ref.test.func (ptr %func , double poison )
8686 tail call void @use (i32 noundef %res ) #3
8787 ret void
8888}
@@ -100,7 +100,7 @@ define void @test_fpsig_param_i32(ptr noundef %func) local_unnamed_addr #0 {
100100; CHECK-NEXT: call use
101101; CHECK-NEXT: # fallthrough-return
102102entry:
103- %res = tail call i32 (ptr , ...) @llvm.wasm.ref.test.func (ptr %func , token poison, double 0 . )
103+ %res = tail call i32 (ptr , ...) @llvm.wasm.ref.test.func (ptr %func , token poison, double poison )
104104 tail call void @use (i32 noundef %res ) #3
105105 ret void
106106}
@@ -118,7 +118,7 @@ define void @test_fpsig_multiple_params_and_returns(ptr noundef %func) local_unn
118118; CHECK-NEXT: call use
119119; CHECK-NEXT: # fallthrough-return
120120entry:
121- %res = tail call i32 (ptr , ...) @llvm.wasm.ref.test.func (ptr %func , i32 0 , i64 0 , float 0 . , double 0 . , token poison, i64 0 , float 0 . , i64 0 )
121+ %res = tail call i32 (ptr , ...) @llvm.wasm.ref.test.func (ptr %func , i32 poison , i64 poison , float poison , double poison , token poison, i64 poison , float poison , i64 poison )
122122 tail call void @use (i32 noundef %res ) #3
123123 ret void
124124}
@@ -137,10 +137,26 @@ define void @test_fpsig_ptrs(ptr noundef %func) local_unnamed_addr #0 {
137137; CHECK-NEXT: call use
138138; CHECK-NEXT: # fallthrough-return
139139entry:
140- %res = tail call i32 (ptr , ...) @llvm.wasm.ref.test.func (ptr %func , ptr null , token poison, ptr null , ptr null )
140+ %res = tail call i32 (ptr , ...) @llvm.wasm.ref.test.func (ptr %func , ptr poison , token poison, ptr poison , ptr poison )
141141 tail call void @use (i32 noundef %res ) #3
142142 ret void
143143}
144144
145+ define void @test_reference_types (ptr noundef %func ) local_unnamed_addr #0 {
146+ ; CHECK-LABEL: test_reference_types:
147+ ; CHK32: .functype test_reference_types (i32) -> ()
148+ ; CHK64: .functype test_reference_types (i64) -> ()
149+ ; CHECK-NEXT: # %bb.0: # %entry
150+ ; CHECK-NEXT: local.get 0
151+ ; CHK64-NEXT: i32.wrap_i64
152+ ; CHECK-NEXT: table.get __indirect_function_table
153+ ; CHECK-NEXT: ref.test (funcref, externref) -> (externref)
154+ ; CHECK-NEXT: call use
155+ ; CHECK-NEXT: # fallthrough-return
156+ entry:
157+ %res = tail call i32 (ptr , ...) @llvm.wasm.ref.test.func (ptr %func , ptr addrspace (10 ) poison, token poison, ptr addrspace (20 ) poison, ptr addrspace (10 ) poison)
158+ tail call void @use (i32 noundef %res ) #3
159+ ret void
160+ }
145161
146162declare void @use (i32 noundef) local_unnamed_addr #1
0 commit comments