LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 39524 - Replace lli with %lli in RUN lines
Summary: Replace lli with %lli in RUN lines
Status: NEW
Alias: None
Product: Test Suite
Classification: Unclassified
Component: lit (show other bugs)
Version: trunk
Hardware: PC Linux
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-01 15:40 PDT by Eugene Sharygin
Modified: 2018-11-03 02:46 PDT (History)
5 users (show)

See Also:
Fixed By Commit(s):


Attachments
WIP patch for converting all tests to %lli (13.75 KB, patch)
2018-11-01 15:40 PDT, Eugene Sharygin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Sharygin 2018-11-01 15:40:15 PDT
Created attachment 21063 [details]
WIP patch for converting all tests to %lli

`lit.cfg.py` defines substitutions for both `lli` and `%lli`, and this is
confusing, especially since there is no actual difference between these two
except that on Windows `%lli` includes an `-mtriple=' flag force-setting ELF
object format.

There is even a FIXME in `test/lit.cfg.py' about this very thing:

> # FIXME: Why do we have both `lli` and `%lli` that do slightly different
> things?

It seems like the majority of tests could be converted to use one or the other.
If all tests can be converted to one substitution, the other one should be removed.
If there is a minority of tests that depend on the other substitution,
that substitution should be renamed to something special a la `%llc_dwarf` to
clearly indicate that it is a special case and not the default.

I included a patch that converts everything to `%lli`, but I don't know if it
really works because I don't have a Windows machine to test it on.
Comment 1 Matthias Braun 2018-11-01 15:44:23 PDT
FWIW: It seems that for most tools shipping with llvm (llc, opt, etc.) we just use the version with a '%' prefix. I think those are listed in the tools.extend list.

I recommend putting the patch up on phabricator and subscribing some people that are active on windows to the review.
Comment 2 Matthias Braun 2018-11-01 15:45:04 PDT
> we just use the version with a '%' prefix.

That should have been: ... the version *without* a '%' prefix
Comment 3 Reid Kleckner 2018-11-02 08:52:52 PDT
(In reply to Matthias Braun from comment #2)
> > we just use the version with a '%' prefix.
> 
> That should have been: ... the version *without* a '%' prefix

+1
Comment 4 Eugene Sharygin 2018-11-03 02:46:14 PDT
(In reply to Matthias Braun from comment #2)
> > we just use the version with a '%' prefix.
> 
> That should have been: ... the version *without* a '%' prefix

That's because there is no '%'-prefixed version of llc, opt, etc.

The majority of tests that run lli use `%lli` (~170 vs ~18), and I think it
should stay that way if an `-mtriple` flag is required because otherwise
(if the flag is attached to `lli` in `lit.cfg.py`) there will be no simple way
of setting a different triple for a test run since `-mtriple` can occur at most
once, and it may also seem just more confusing to people.

(In reply to Matthias Braun from comment #1)
> I recommend putting the patch up on phabricator and subscribing some people
> that are active on windows to the review.

Thank you for advice, but I'm not sure. The WIP patch was just a simple
search-and-replace job because on my machine `%lli` and `lli` are the same.
Most of work is still to be done, and I can't contribute any of it. If the
thinking is that this little issue won't get enough attention from the right
people here, would you think posting on llvm-dev will help? If you still think
posting this patch on Phabricator is more appropriate I will do it.