28 lines · plain
1; RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %p/Inputs/ret32.s -o %t.ret32.o2; RUN: llc -filetype=obj %s -o %t.main.o3; RUN: wasm-ld --fatal-warnings -o %t.wasm %t.ret32.o %t.main.o4; RUN: wasm-ld --fatal-warnings -o %t.wasm %t.main.o %t.ret32.o5 6; Also test the case where there are two different object files that contains7; references ret32:8; %t.main.o: Does not call ret32 directly; used the wrong signature.9; %t.call-ret32.o: Calls ret32 directly; uses the correct signature.10; RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %p/Inputs/call-ret32.s -o %t.call-ret32.o11; RUN: wasm-ld --export=call_ret32 --fatal-warnings -o %t.wasm %t.main.o %t.call-ret32.o %t.ret32.o12; RUN: wasm-ld --export=call_ret32 --fatal-warnings -o %t.wasm %t.call-ret32.o %t.main.o %t.ret32.o13 14target triple = "wasm32-unknown-unknown"15 16; Function declaration with incorrect signature.17declare dso_local void @ret32()18 19; Simply taking the address of the function should *not* generate the20; the signature mismatch warning.21@ptr = dso_local global ptr @ret32, align 822 23define hidden void @_start() local_unnamed_addr {24 %addr = load ptr, ptr @ptr, align 825 call i32 %addr()26 ret void27}28