1; RUN: llvm-as %s -o %t.o
2; RUN: wasm-ld %t.o -o %t.wasm
3; RUN: obj2yaml %t.wasm | FileCheck %s
4
5; Test that undefined weak external functions are handled in the LTO case
6; We had a bug where stub function generation was failing because functions
7; that are in bitcode (pre-LTO) don't have signatures assigned.
8
9target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
10target triple = "wasm32-unknown-unknown"
11
12declare extern_weak i32 @foo()
13
14define void @_start() #0 {
15entry:
16    %call2 = call i32 @foo()
17    ret void
18}
19
20; CHECK: Name:            'undefined_weak:foo'
21