Test case for Bug 20485 (fixed in commit 293d3de)
Details
Diff Detail
Event Timeline
lib/Bitcode/Reader/BitstreamReader.cpp | ||
---|---|---|
252 | Please include a diagnostic. | |
302–303 | clang-format the patch please. | |
test/Bitcode/bad-abbrev-record.txt.stderr | ||
1 ↗ | (On Diff #18240) | Why do you need this to be in another file? |
test/ExecutionEngine/MCJIT/eh-lg-pic.ll | ||
2 ↗ | (On Diff #18240) | Unrelated? |
tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp | ||
415 | Ah, so you have a diagnostic here. Please move it down to where the problem is first detected. That should allow you to print a better message. |
tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp | ||
---|---|---|
415 | I chose to put the diagnostic here because that was more consistent with prior use of the API and in particular there are other clients in llvm/tools/clang (with a separate revision) that have different diagnostic needs. |
Eliminated some inadvertent files modified on the branch.
Cleaned up the test case as suggested.
Addressed code format.
I chose to put the diagnostic here because that was more consistent with prior use of the API and in particular there are other clients in llvm/tools/clang (with a separate revision) that have different diagnostic needs.
The code was just changed to even have support for diagnostics. Please
move it to where it is found. With that you can give an error like
"Value XX is not a valid encoding"
Cheers,
Rafael
Ah, and about the formatting. You can just run "git-clang-format
master" in your branch to have it format the patch for you.
This looks good, minus the formatting in some places. Rafael's hint should help :-)
Please also change the report_fatal_error back into llvm_unreachable in include/llvm/Bitcode/BitCodes.h:128, since we're not supposed to get to that point anymore (You'll also have to remove the invalid.test Bitcode test, and test/Bitcode/Inputs/invalid-pr20485.bc)
Thanks for improving this!
include/llvm/Bitcode/BitCodes.h | ||
---|---|---|
99 | Please run clang-format here too. | |
test/Bitcode/bad-abbrev-record.txt | ||
2 | Shouldn't it be "malformed bitcode file"? |
The existing trunk already has a smaller change to fix the bug so I intend
to abandon this revision.
I will propose a test case though and then close the bug.
david
Hi David,
Can you do what I've been doing and add the run lines to
test/Bitcode/invalid.test, and the invalid testcase with a name matching
invalid-*.bc to test/Bitcode/Inputs/?
That way, the invalid test cases are all in the same place.
Thanks,
Filipe
Please run clang-format here too.