46 lines · plain
1; RUN: rm -rf %t && split-file %s %t && cd %t2; RUN: opt -thinlto-bc a.ll -o a.o3; RUN: opt -thinlto-bc b.ll -o b.o4; RUN: llvm-ar rcs b.a b.o5; RUN: opt -thinlto-bc c.ll -o c.o6 7;; Taking the address of the incorrectly declared @foo should not generate a warning.8; RUN: wasm-ld --fatal-warnings --no-entry --export-all a.o b.a -o a.out \9; RUN: | FileCheck %s --implicit-check-not 'warning' --allow-empty10 11;; But we should still warn if we call the function with the wrong signature.12; RUN: not wasm-ld --fatal-warnings --no-entry --export-all a.o b.a c.o -o b.out 2>&1 \13; RUN: | FileCheck %s --check-prefix=INVALID14 15; INVALID: error: function signature mismatch: foo16; INVALID: >>> defined as () -> void17; INVALID: >>> defined as () -> i3218 19;--- a.ll20target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20"21target triple = "wasm32-unknown-unknown"22 23@ptr = constant ptr @foo24declare void @foo()25 26;--- b.ll27target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20"28target triple = "wasm32-unknown-unknown"29 30define i32 @foo() noinline {31entry:32 ret i32 4233}34 35;--- c.ll36target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20"37target triple = "wasm32-unknown-unknown"38 39declare void @foo()40 41define void @invalid() {42entry:43 call void @foo()44 ret void45}46