1 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s
2 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t2.o %S/Inputs/sig_mismatch.s
3 # RUN: wasm-ld --relocatable %t.o %t2.o -o %t.wasm
4 # RUN: obj2yaml %t.wasm | FileCheck %s
6 # Regression test for handling of signature mismatches (variant function
7 # symbols) and relocatable output. This issue only occurred when the undefined
8 # function was seen first and the defined function was referenced within the
9 # the defining file (see %S/Inputs/sig_mismatch.s).
11 .functype foo (i32, i64, i32) -> (i32)
15 .functype _start () -> ()
23 # CHECK: - Type: CUSTOM
24 # CHECK-NEXT: Name: linking
25 # CHECK-NEXT: Version: 2
26 # CHECK-NEXT: SymbolTable:
27 # CHECK-NEXT: - Index: 0
28 # CHECK-NEXT: Kind: FUNCTION
29 # CHECK-NEXT: Name: _start
30 # CHECK-NEXT: Flags: [ ]
31 # CHECK-NEXT: Function: 1
32 # CHECK-NEXT: - Index: 1
33 # CHECK-NEXT: Kind: FUNCTION
34 # CHECK-NEXT: Name: foo
35 # CHECK-NEXT: Flags: [ ]
36 # CHECK-NEXT: Function: 2
37 # CHECK-NEXT: - Index: 2
38 # CHECK-NEXT: Kind: FUNCTION
39 # CHECK-NEXT: Name: call_foo
40 # CHECK-NEXT: Flags: [ ]
41 # CHECK-NEXT: Function: 3
42 # CHECK-NEXT: - Index: 3
43 # CHECK-NEXT: Kind: FUNCTION
44 # CHECK-NEXT: Name: 'signature_mismatch:foo'
45 # CHECK-NEXT: Flags: [ BINDING_LOCAL ]
46 # CHECK-NEXT: Function: 0
47 # CHECK-NEXT: - Type: CUSTOM
48 # CHECK-NEXT: Name: name
49 # CHECK-NEXT: FunctionNames:
50 # CHECK-NEXT: - Index: 0
51 # CHECK-NEXT: Name: 'signature_mismatch:foo'
52 # CHECK-NEXT: - Index: 1
53 # CHECK-NEXT: Name: _start
54 # CHECK-NEXT: - Index: 2
55 # CHECK-NEXT: Name: foo
56 # CHECK-NEXT: - Index: 3
57 # CHECK-NEXT: Name: call_foo