https://bugs.llvm.org/show_bug.cgi?id=39557

            Bug ID: 39557
           Summary: AsmParser cannot recognize function types without
                    definitions
           Product: libraries
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: WebAssembly
          Assignee: unassignedb...@nondot.org
          Reporter: ahee...@gmail.com
                CC: llvm-bugs@lists.llvm.org

Created attachment 21082
  --> https://bugs.llvm.org/attachment.cgi?id=21082&action=edit
Test case .ll file

When there is a function call to a function that does not have a definition, if
we generate .s file using `llc` and generate .o file from it using `llvm-mc`,
the function symbol is recognized as not a function but a data.

Commands that reproduce the bug:
```
llc -filetype=asm -asm-verbose=false test.ll -o test.s
llvm-mc -triple=wasm32-unknown-unknown -filetype=obj test.s -o test_from_s.o
obj2yaml test_from_s.o > test_from_s.yaml

llc -filetype=obj test.ll -o test.o
obj2yaml test.o > test.yaml
```

test.yaml and test_from_s.yaml are supposed to be the same, but they are not.
In test_from_s.yaml, foo, which is defined, is listed as a function symbol, but
bar, which is not defined, is listed as data.
```
    SymbolTable:
      - Index:           0
        Kind:            FUNCTION
        Name:            foo
        Flags:           [ BINDING_LOCAL ]
        Function:        0
      - Index:           1
        Kind:            DATA
        Name:            bar
        Flags:           [ UNDEFINED ]
```

And consequentially, it has no function import entry in the 'Import' section,
and no type signature entry in 'Type' section as well.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to