In this PR, unnamed machine functions in an MIR file are associated with anonymous functions in the embedded LLVM IR according to the order in which they are specified. If there are more unnamed machine functions then there are LLVM IR functions, the parsing will fail by reporting the original error message of `function ‘’ isn’t defined in the provided LLVM IR`. Closes #36511
32 lines
500 B
YAML
32 lines
500 B
YAML
# RUN: llc -run-pass=none -o - %s | FileCheck %s
|
|
# This test ensures that the MIR parser accepts files with unnamed functions.
|
|
--- |
|
|
; CHECK: define void @0
|
|
define void @0() {
|
|
; CHECK: ret void
|
|
ret void
|
|
}
|
|
|
|
; CHECK: define void @foo
|
|
define void @foo() {
|
|
; CHECK: ret void
|
|
ret void
|
|
}
|
|
|
|
; CHECK: define i32 @1
|
|
define i32 @1() {
|
|
; CHECK: ret i32 0
|
|
ret i32 0
|
|
}
|
|
...
|
|
---
|
|
# CHECK: name: ''
|
|
name: ''
|
|
---
|
|
# CHECK: name: foo
|
|
name: foo
|
|
---
|
|
# CHECK: name: ''
|
|
name: ''
|
|
...
|