llvm.org GIT mirror llvm / d8a0ff3
MIR Parser: Report an error when a machine function doesn't have a corresponding function. This commit reports an error when a machine function from a MIR file that contains LLVM IR can't find a function with the same name in the loaded LLVM IR module. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10468 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239831 91177308-0d34-0410-b5e6-96231b3b80d8 Alex Lorenz 5 years ago
2 changed file(s) with 22 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
172172 Functions.insert(std::make_pair(FunctionName, std::move(MF)));
173173 if (NoLLVMIR)
174174 createDummyFunction(FunctionName, M);
175 else if (!M.getFunction(FunctionName))
176 return error(Twine("function '") + FunctionName +
177 "' isn't defined in the provided LLVM IR");
175178 return false;
176179 }
177180
0 # RUN: not llc -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s
1 # This test ensures that an error is reported when the mir file has LLVM IR and
2 # one of the machine functions has a name that doesn't match any function in
3 # the LLVM IR.
4
5 --- |
6
7 define i32 @foo() {
8 ret i32 0
9 }
10
11 ...
12 ---
13 name: foo
14 ...
15 ---
16 # CHECK: function 'faa' isn't defined in the provided LLVM IR
17 name: faa
18 ...