<div dir="ltr">Hi, I'm the author of that blog post.<div><br></div><div>Without knowing the details of your issue, my guess is that somehow LIT didn't execute the correct config file. </div><div>Long story short, there are two LIT config files: The one you put in source directory (<a href="http://lit.cfg.py">lit.cfg.py</a>) and the other one (<a href="http://lit.site.cfg.py">lit.site.cfg.py</a>), which is generated from a template file (<a href="http://lit.site.cfg.py.in">lit.site.cfg.py.in</a>), in the build direcotry</div><div>The latter one is the config file LIT should execute first, because it's actually a trampoline that sets up some environment -- the my_obj_root is one of them -- before executing the real config file, <a href="http://lit.cfg.py">lit.cfg.py</a> in the source directory.</div><div><br></div><div>To answer your section question, there _is_ a simpler way to run LIT: Write a simple <a href="http://lit.cfg.py">lit.cfg.py</a>, put side by side with your test file, and launch LIT at the same directory, period. IIRC this is also the example I showed at the beginning of the blog post.</div><div>The problem is, if you have a separate build directory -- just like LLVM or most of the CMake-based projects -- you will have a hard time configuring the path to your program using this simple setup. The fancy trampoline trick adopted by LLVM is only designed to configure the paths to various tools -- like clang and opt -- used in the test file.</div><div><br></div><div>Hope that answer your question</div><div>-Min<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 30, 2021 at 8:27 AM Tejas Joshi via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
So far, I have been copying .ll lit bases test cases in some<br>
/llvm-project/llvm/test/<directory><br>
and then running them with<br>
/build-dir/bin/llvm-lit.<br>
<br>
Now, I need to run these test cases without adding them to llvm source, using<br>
/build-dir/bin/llvm-lit<br>
or<br>
/install-dir/bin/llvm-lit<br>
So to create similar test suite environment outside of source, I followed:<br>
<<a href="https://medium.com/@mshockwave/using-llvm-lit-out-of-tree-5cddada85a78" rel="noreferrer" target="_blank">https://medium.com/@mshockwave/using-llvm-lit-out-of-tree-5cddada85a78</a>><br>
with some relevant changes but I am stumbling on error:<br>
AttributeError: 'TestingConfig' object has no attribute 'my_obj_root'<br>
<br>
Any changes that I am missing here?<br>
<br>
OR<br>
Regardless of the above link. Is there a simpler way to do this where<br>
I can run any IR based test cases outside of llvm source while<br>
referring to the corresponding tool in /build-dir/bin/ or<br>
/install-dir/bin/?<br>
<br>
Thanks,<br>
Tejas<br>
_______________________________________________<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="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Min-Yih Hsu</div><div>Ph.D Student in ICS Department, University of California, Irvine (UCI).<br></div></div></div>