Can't you use the preprocessor to produce a large output? See the testcase in https://llvm.org/bugs/show_bug.cgi?id=10651#c10 for example.
Cheers, Rafael On 21 December 2015 at 20:07, Yunzhong Gao via cfe-commits <cfe-commits@lists.llvm.org> wrote: > ygao created this revision. > ygao added subscribers: cfe-commits, rsandifo, majnemer, aaron.ballman. > > Hi, > I am trying to add a test for PR25717. The test itself is fairly > straight-forward: it generates a > large .c temporary file on the fly and then runs the preprocessor over the > generated file to > make sure we do not see any unexpected fatal errors. > I have never added a scripted test before, so it would be really nice if > someone with this > experience could take a look that I did make all the necessary changes. > Many thanks in advance, > - Gao > > http://reviews.llvm.org/D15705 > > Files: > test/Preprocessor/bigoutput.py > test/Preprocessor/lit.local.cfg > > Index: test/Preprocessor/lit.local.cfg > =================================================================== > --- test/Preprocessor/lit.local.cfg > +++ test/Preprocessor/lit.local.cfg > @@ -0,0 +1,2 @@ > +config.suffixes = ['.c', '.cpp', '.m', '.mm', '.cu', '.cl', '.s', '.S', > '.py'] > + > Index: test/Preprocessor/bigoutput.py > =================================================================== > --- test/Preprocessor/bigoutput.py > +++ test/Preprocessor/bigoutput.py > @@ -0,0 +1,11 @@ > +# RUN: python %s > +# RUN: %clang_cc1 -E -x c bigoutput.c | FileCheck %s > + > +# Make sure clang does not crash during preprocessing > +# CHECK-NOT: fatal error > + > +f = open("bigoutput.c", "wb") > +for i in range(0, 15000): > + # this test requires UNIX line endings > + f.write("int v%d;\n" % i) > +f.close() > > > > _______________________________________________ > cfe-commits mailing list > cfe-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits > _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits