<div dir="ltr"><div><div>I am far from an expert on this since I've only ever added one or two of these IIRC. But as far as I remember, for most purposes, that's all you need. Add a source file, add an expected file and add the source file to the CMakeLists.txt (along with any additional CFLAGS/CXXFLAGS/LDFLAGS)...<br></div>Of course, if you need anything custom, there are likely examples in the test suite that you can use for guidance.<br></div>Also, this may be of some help:<br><a href="https://llvm.org/docs/TestSuiteMakefileGuide.html">https://llvm.org/docs/TestSuiteMakefileGuide.html</a><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 2, 2018 at 9:14 PM, Eli Davis <span dir="ltr"><<a href="mailto:eli@aarno-labs.com" target="_blank">eli@aarno-labs.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p>Ah, thank you, that makes sense.</p>
    <p>Is there any chance you can point me toward some documentation
      for how to add tests to the test-suite? I've found a fair bit on
      how to run the tests, but nothing on how to add new ones. Is it
      just as simple as adding testcase.c and testscase.reference_output
      in the appropriate directory?</p>
    <p>Thanks!<br>
    </p>
    <br>
    <div class="m_6632507490405097252moz-cite-prefix">On 01/02/2018 02:50 PM, Nemanja
      Ivanovic wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">Typically the "end-to-end" test cases reside in
        `projects/test-suite`. All the test cases there build executable
        binaries from source, run those and compare the output (as well
        as the return code) to what's expected. You should probably put
        your test cases in there. Please note also that there are
        subcategories there - there are single source file and multiple
        source file programs. There are those that are meant as
        benchmarks, unit tests, full applications, etc. I'm sure you can
        find an appropriate place to add your test cases to.<br>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Tue, Jan 2, 2018 at 8:16 PM, Eli
          Davis via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
            <br>
            I am writing an instrumentation pass using LLVM. I have unit
            tests using llvm-lit in the style of the tests in llvm/test
            to make sure the IR changes show up in the correct place. I
            would also like to have some end-to-end tests that start
            from a .c file, compile the program, run it, and check the
            output.<br>
            <br>
            I imagine I could do this as a test in the same style, but
            I'm wondering if that's the llvm-correct way of doing it.
            Can anyone advise?<br>
            <br>
            Thank you!<br>
            <br>
            Eli<br>
            <br>
            ______________________________<wbr>_________________<br>
            LLVM Developers mailing list<br>
            <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
            <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </div>

</blockquote></div><br></div>