[cfe-dev] A tool for generating reduced headers for test cases(delta debugging)

Nuno Lopes nunoplopes at sapo.pt
Wed Jul 9 11:55:37 PDT 2008


> On Wed, Jul 9, 2008 at 1:49 AM, Nikita Zhuk <nikita at zhuk.fi> wrote:
>> Hi,
>>
>> Several clang analysis test cases written in ObjC contain the
>> following comment line in their header: "These declarations were
>> reduced using Delta-Debugging from Foundation.h on Mac OS X.". Are
>> there some instructions about tools which should be used to generate
>> such reduced headers?
>
> If I'm not mistaken, the steps are just to generate a full file with
> clang -E, then reduce the file using Delta (http://delta.tigris.org/).
> But Ted should be able to comment with more complete steps.

I'm not Ted :), but I've attached 2 script that I regularly use. I have 
more, which have other combinations.
For example, imagine you want to reduce a test case that crashes clang. 
After the preprocessing, you would run (several times):
multidelta -level=x ./crash_clang a.c

the level (x) is a number between e.g. 0 and 10. Check the delta manual for 
how to best pick up a number.

Now suppose clang triggers a error that gcc does not. Then you can use the 
clang_error script (provided you changed it to grep for your specific 
error).

Nuno 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang_error
Type: application/octet-stream
Size: 319 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080709/ed7fb96a/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crash_clang
Type: application/octet-stream
Size: 231 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080709/ed7fb96a/attachment-0001.obj>


More information about the cfe-dev mailing list