[llvm-commits] [llvm] r158769 - /llvm/trunk/lib/Support/StreamableMemoryObject.cpp

Chandler Carruth chandlerc at google.com
Wed Jun 20 10:28:38 PDT 2012


On Wed, Jun 20, 2012 at 10:27 AM, Kaelyn Uhrain <rikka at google.com> wrote:

>
>
> On Tue, Jun 19, 2012 at 5:41 PM, Chandler Carruth <chandlerc at google.com>wrote:
>
>> On Tue, Jun 19, 2012 at 5:36 PM, Chandler Carruth <chandlerc at google.com>wrote:
>>
>>> On Tue, Jun 19, 2012 at 5:16 PM, Kaelyn Uhrain <rikka at google.com> wrote:
>>>
>>>> Author: rikka
>>>> Date: Tue Jun 19 19:16:40 2012
>>>> New Revision: 158769
>>>>
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=158769&view=rev
>>>> Log:
>>>> Don't assert when given an empty range.
>>>>
>>>> llvm::RawMemoryObject handles empty ranges just fine, and the assert can
>>>> be triggered in the wild by e.g. invoking clang with a file that
>>>> included an empty pre-compiled header file when clang has been built
>>>> with assertions enabled. Without assertions enabled, clang will properly
>>>> report that the empty file is not a valid PCH.
>>>>
>>>
>>> Add a test case that builds an empty pre-compiled header and invokes
>>> clang with it?
>>>
>>
>> Never mind, I see your commit now.
>>
>> Also, I wonder, are there any unittests for this? If so, we should add a
>> unittest that covers this case. Not worth adding a completely new unittest
>> though...
>>
>
> I would have added a unit test in llvm for it, but I don't know what in
> llvm uses this code. Hence just the clang unit test...
>

We're trying to build up actual GoogleTest style unit tests for the core
LLVM libraries like Support and ADT specifically because their users are
often in other projects.

 unittests/Support/... has the various unittests added thus far for
Support. Not sure if this class currently has any though.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120620/c11f9a57/attachment.html>


More information about the llvm-commits mailing list