[llvm] r179285 - Add a function to check if an argument list is too long.

Nathan Froyd nfroyd at mozilla.com
Fri Apr 12 07:23:34 PDT 2013


On Fri, Apr 12, 2013 at 09:10:19AM -0400, Rafael EspĂ­ndola wrote:
> >> That is why my suggestion is to just test that the clang driver works
> >> when given a large command line. It might work because the system it
> >> is running in has a really large limit (current linux for example) or
> >> because it is creating an @file.
> >
> > I don't see how this will be easier than a unit test...
> 
> It is not easier, but
> * We will have to do something to test the clang side.
> * It tests what the user really wants: i.e.: the driver can invoke the
> subcommand.

It's still going to be fairly expensive, though.  The maximum command
line length on Windows is 32K.  On OS X, ARG_MAX appears to be ~10x that
and (recent) Linux has an ARG_MAX ~10x bigger still.  So using Windows
as a baseline, and generously assuming that all the files fed to the
driver are MAX_PATH length characters (260), we'll need a testcase with
~250 files.  Doubling or quadrupling that is probably more realistic.
And even then, depending on the location of the clang source tree, it's
still not obvious that the test is actually going to be testing what
it's expected to.

Am I missing something obvious here?  Or is a testcase with 1000 simple
input files really what should be checked in?

-Nathan 



More information about the llvm-commits mailing list