<div dir="ltr">FWIW, huge +1 from me too. This and some minor tweaks to the CMake build are I think thing biggest technical hurdles left to being entirely reasonable to start encouraging widespread buliding and using of the runtime by random Clang developers, etc.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jul 16, 2015 at 8:14 PM Hal Finkel <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">----- Original Message -----<br>
> From: "Jonathan L Peyton" <<a href="mailto:jonathan.l.peyton@intel.com" target="_blank">jonathan.l.peyton@intel.com</a>><br>
> To: "Sunita Chandrasekaran" <<a href="mailto:sunita@cs.uh.edu" target="_blank">sunita@cs.uh.edu</a>><br>
> Cc: <a href="mailto:openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">openmp-dev@dcs-maillist2.engr.illinois.edu</a><br>
> Sent: Thursday, July 16, 2015 8:23:29 PM<br>
> Subject: Re: [Openmp-dev] Switching testsuite to llvm-lit<br>
><br>
><br>
><br>
><br>
><br>
> From what I can tell, the current testsuite is triggered through<br>
> Makefile targets to call <a href="http://runtest.pl" rel="noreferrer" target="_blank">runtest.pl</a> which generates, then compiles,<br>
> then runs the various tests, then at some point each test is<br>
> compiled into the LLVM IR and RUN: and CHECK: lines are prepended to<br>
> that generated file (.ll). These are then run through lit. So the<br>
> tests get checked twice, once by the Perl system and once by lit.<br>
> What I want is for there to be plain ole C files that are the tests.<br>
> These C files should have the RUN: and CHECK: lines with no Perl<br>
> required to generate the test files. I’m currently making a<br>
> concerted effort to have the entire build system Perl-free. Another<br>
> thing I’m confused about is the <a href="http://lit.site.cfg.in" rel="noreferrer" target="_blank">lit.site.cfg.in</a> file which has to be<br>
> configured to be used. I don’t see any place where this is<br>
> configured in the current system. I may be missing it though.<br>
><br>
><br>
><br>
> So, in short, I’m trying to get rid of the “middle-man” Perl step<br>
> which generates, compiles, and runs the test files, by just having<br>
> the test files be standalone C files which lit can handle. Also,<br>
> these changes would enable different generators to test OpenMP, for<br>
> example Ninja build systems. The tests themselves are great, and I<br>
> truly appreciate their contribution, but they need to be better<br>
> integrated into the current standalone CMake build system and the<br>
> LLVM build system as a whole.<br>
><br>
<br>
That's right. The test files should just be in C/C++; the setup should mirror that for compiler-rt and libc++.<br>
<br>
 -Hal<br>
<br>
><br>
><br>
> -- Johnny<br>
><br>
><br>
><br>
> From: <a href="mailto:sunisg123@gmail.com" target="_blank">sunisg123@gmail.com</a> [mailto:<a href="mailto:sunisg123@gmail.com" target="_blank">sunisg123@gmail.com</a>] On Behalf Of<br>
> Sunita Chandrasekaran<br>
> Sent: Thursday, July 16, 2015 6:44 PM<br>
> To: Peyton, Jonathan L<br>
> Cc: <a href="mailto:openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">openmp-dev@dcs-maillist2.engr.illinois.edu</a><br>
> Subject: Re: [Openmp-dev] Switching testsuite to llvm-lit<br>
><br>
><br>
><br>
><br>
> Hi Jonathan<br>
><br>
><br>
> Going through your steps, I am thinking this is close to what we (UH)<br>
> had done and committed to the llvm trunk, especially creating those<br>
> .cfg files and the RUN rules ?<br>
><br>
><br>
> Sorry if I am mistaken.<br>
><br>
><br>
><br>
><br>
><br>
> If what you are doing takes what we did and makes it more compatible<br>
> to llvm-lit, I understand that. But I would hope that you don't have<br>
> to start from scratch..<br>
><br>
><br>
> Our testsuite was also using llvm-lit.<br>
><br>
><br>
><br>
><br>
><br>
> -Sunita<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> On Thu, Jul 16, 2015 at 4:01 PM, Peyton, Jonathan L <<br>
> <a href="mailto:jonathan.l.peyton@intel.com" target="_blank">jonathan.l.peyton@intel.com</a> > wrote:<br>
><br>
><br>
><br>
><br>
><br>
> Hello everyone,<br>
><br>
><br>
><br>
> It has been requested, rightfully so, on more than one occasion that<br>
> the testsuite be llvm-lit compatible. This means calling llvm-lit<br>
> directly inside the testsuite directory where it would pick up the<br>
> configuration from lit.site.cfg and then run each test similar to<br>
> other LLVM projects. Perl would neither exist nor be required as it<br>
> is now for running the tests. I was beginning to work on converting<br>
> this and would like input, feedback on this process.<br>
><br>
><br>
><br>
> What I’ve done so far includes:<br>
><br>
> 1) Creating the tests --- Right now, the tests are stored as template<br>
> files that must be translated by a perl script. I’ve manually<br>
> generated all the tests by running inside the testsuite/ directory<br>
><br>
> $ <a href="http://template_parser_c.pl" rel="noreferrer" target="_blank">template_parser_c.pl</a> --test --noorphan c/$filename $filename<br>
><br>
> This generates all the tests indentically to how <a href="http://runtest.pl" rel="noreferrer" target="_blank">runtest.pl</a> does so.<br>
><br>
> 2) I’ve then cleaned up the files, removing any reference to a<br>
> logFile (llvm-lit will log for you) and cleaned up the typical<br>
> generated code formatting problems so it looks like acceptable C<br>
> code.<br>
><br>
> 3) Then, I’ve created a basic <a href="http://lit.site.cfg.in" rel="noreferrer" target="_blank">lit.site.cfg.in</a> file and a basic<br>
> lit.cfg file (both based off of libcxx’s)<br>
><br>
> 4) Lastly, I’ve been able to successfully run the tests using<br>
> llvm-lit directly, but not yet from the build system itself as<br>
> <a href="http://lit.site.cfg.in" rel="noreferrer" target="_blank">lit.site.cfg.in</a> still needs work (I manually configure lit.site.cfg<br>
> then run llvm-lit).<br>
><br>
><br>
><br>
> Each test looks similar to the one below where the RUN: line says to<br>
> compile the source file (%s) put it in a temp file (%t) , run the<br>
> temp file, and compare the output of the temp file with the CHECK:<br>
> line below. if Pass was printed, then the test passed, if not then<br>
> the test failed.<br>
><br>
><br>
><br>
> // RUN: %clang %openmp_flag %cflags %s -o %t && %t | FileCheck %s<br>
><br>
> #include <stdio.h><br>
><br>
> #include "omp_testsuite.h"<br>
><br>
> #include "omp_my_sleep.h"<br>
><br>
><br>
><br>
> int test_omp_for_nowait()<br>
><br>
> {<br>
><br>
> [code to test it]<br>
><br>
> }<br>
><br>
><br>
><br>
> int main()<br>
><br>
> {<br>
><br>
> int i;<br>
><br>
> int num_failed=0;<br>
><br>
><br>
><br>
> for(i = 0; i < REPETITIONS; i++) {<br>
><br>
> if(!test_omp_for_nowait()) {<br>
><br>
> num_failed++;<br>
><br>
> }<br>
><br>
> }<br>
><br>
><br>
><br>
> if(num_failed==0) {<br>
><br>
> printf("Pass\n");<br>
><br>
> } else {<br>
><br>
> printf("Failed %d out of %d times\n", num_failed, REPETITIONS);<br>
><br>
> }<br>
><br>
> // CHECK: Pass<br>
><br>
> return num_failed;<br>
><br>
> }<br>
><br>
><br>
><br>
> Any feedback or comments are welcome. I was going to continue to work<br>
> on it and get a first working iteration that could be run from a<br>
> CMake build tree, then post a patch of the new files.<br>
><br>
><br>
><br>
> -- Johnny<br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Openmp-dev mailing list<br>
> <a href="mailto:Openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">Openmp-dev@dcs-maillist2.engr.illinois.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/openmp-dev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/openmp-dev</a><br>
><br>
><br>
> _______________________________________________<br>
> Openmp-dev mailing list<br>
> <a href="mailto:Openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">Openmp-dev@dcs-maillist2.engr.illinois.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/openmp-dev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/openmp-dev</a><br>
><br>
<br>
--<br>
Hal Finkel<br>
Assistant Computational Scientist<br>
Leadership Computing Facility<br>
Argonne National Laboratory<br>
<br>
_______________________________________________<br>
Openmp-dev mailing list<br>
<a href="mailto:Openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">Openmp-dev@dcs-maillist2.engr.illinois.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/openmp-dev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/openmp-dev</a><br>
</blockquote></div>