<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>LLVM Test Suite Guide</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
<body>
<div class="doc_title">
LLVM Test Suite Guide
</div>
<ol>
<li><a href="#overview">Overview</a></li>
<li><a href="#Requirements">Requirements</a></li>
<li><a href="#org">LLVM Test Suite Organization</a>
<ul>
<li><a href="#codefragments">Code Fragments</a></li>
<li><a href="#wholeprograms">Whole Programs</a></li>
</ul>
</li>
<li><a href="#quick">Quick Start</a>
<ul>
<li><a href="#quickdejagnu">DejaGNU tests</a></li>
<li><a href="#quickllvmtest">llvm-test tests</a></li>
</ul>
</li>
<li><a href="#dgstructure">DejaGNU Structure</a>
<ul>
<li><a href="#customdg">Writing new DejaGNU tests</a></li>
<li><a href="#dgvars">Variables and substitutions</a></li>
<li><a href="#dgfeatures">Other features</a></li>
</ul>
</li>
<li><a href="#llvmteststructure"><tt>llvm-test</tt> Structure</a></li>
<li><a href="#runllvmtest">Running the LLVM Tests</a>
<ul>
<li><a href="#externaltests">Configuring external tests</a></li>
<li><a href="#llvmtesttests">Running different tests</a></li>
<li><a href="#llvmtestoutput">Generating test output</a></li>
<li><a href="#customtest">Writing custom tests for llvm-test</a></li>
</ul>
</li>
<li><a href="#nightly">Running the nightly tester</a></li>
</ol>
<div class="doc_author">
<p>Written by John T. Criswell, <a
href="http://llvm.x10sys.com/rspencer">Reid Spencer</a>, and Tanya Lattner</p>
</div>
<!--=========================================================================-->
<div class="doc_section"><a name="overview">Overview</a></div>
<!--=========================================================================-->
<div class="doc_text">
<p>This document is the reference manual for the LLVM test suite. It documents
the structure of the LLVM test suite, the tools needed to use it, and how to add
and run tests.</p>
</div>
<!--=========================================================================-->
<div class="doc_section"><a name="Requirements">Requirements</a></div>
<!--=========================================================================-->
<div class="doc_text">
<p>In order to use the LLVM test suite, you will need all of the software
required to build LLVM, plus the following:</p>
<dl>
<dt><a href="http://www.gnu.org/software/dejagnu/">DejaGNU</a></dt>
<dd>The Feature and Regressions tests are organized and run by DejaGNU.</dd>
<dt><a href="http://expect.nist.gov/">Expect</a></dt>
<dd>Expect is required by DejaGNU.</dd>
<dt><a href="http://www.tcl.tk/software/tcltk/">tcl</a></dt>
<dd>Tcl is required by DejaGNU. </dd>
<dt><a href="http://www.netlib.org/f2c">F2C</a></dt>
<dd>For now, LLVM does not have a Fortran front-end, but using F2C, we can run
Fortran benchmarks. F2C support must be enabled via <tt>configure</tt> if not
installed in a standard place. F2C requires three items: the <tt>f2c</tt>
executable, <tt>f2c.h</tt> to compile the generated code, and <tt>libf2c.a</tt>
to link generated code. By default, given an F2C directory <tt>$DIR</tt>, the
configure script will search <tt>$DIR/bin</tt> for <tt>f2c</tt>,
<tt>$DIR/include</tt> for <tt>f2c.h</tt>, and <tt>$DIR/lib</tt> for
<tt>libf2c.a</tt>. The default <tt>$DIR</tt> values are: <tt>/usr</tt>,
<tt>/usr/local</tt>, <tt>/sw</tt>, and <tt>/opt</tt>. If you installed F2C in a
different location, you must tell <tt>configure</tt>:
<ul>
<li><tt>./configure --with-f2c=$DIR</tt><br>
This will specify a new <tt>$DIR</tt> for the above-described search
process. This will only work if the binary, header, and library are in their
respective subdirectories of <tt>$DIR</tt>.</li>
<li><tt>./configure --with-f2c-bin=/binary/path --with-f2c-inc=/include/path
--with-f2c-lib=/lib/path</tt><br>
This allows you to specify the F2C components separately. Note: if you choose
this route, you MUST specify all three components, and you need to only specify
<em>directories</em> where the files are located; do NOT include the
filenames themselves on the <tt>configure</tt> line.</li>
</ul></dd>
</dl>
<p>Darwin (Mac OS X) developers can simplify the installation of Expect and tcl
by using fink. <tt>fink install expect</tt> will install both. Alternatively,
Darwinports users can use <tt>sudo port install expect</tt> to install Expect
and tcl.</p>
</div>
<!--=========================================================================-->
<div class="doc_section"><a name="org">LLVM Test Suite Organization</a></div>
<!--=========================================================================-->
<div class="doc_text&qu