<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I'd like to start annotating the libc++ lit tests to indicate which can run in freestanding vs. hosted, while also allowing for vendor extensions to freestanding.  I'm going to need to add a new feature to lit though.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>Recommendation:</b><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Mark all the hosted tests as "REQUIRES: hosted".  Most platforms would have the "hosted" feature set automatically.  Freestanding tests would not have any new REQUIRES attribute added.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
To handle vendor extensions, things get a little more involved.  I would like to add a "REQUIRES_ONE" tag, so that we can put expressions like "REQUIRES_ONE: hosted, darwinKernel" and "REQUIRES_ONE: hosted, winKernel".  The expression would be satisfied so
 long as at least one of the listed features is present.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Pros:<br>
<ul>
<li>Clearly expresses separation between tests required for wg21 compliance and tests of vendor extensions<br>
</li></ul>
<div>Cons:</div>
<div>
<ul>
<li>Requires new lit features</li><li>Requires work on hosted tests to support freestanding (which is backwards)</li><li>Only alludes to freestanding rather than mentioning it directly<br>
</li></ul>
</div>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>Alternative 1:</b></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Use "UNSUPPORTED" instead of "REQUIRES".  Hosted tests would all get "UNSUPPORTED:freestanding".  Vendor extensions would be handled by deny-listing all the other freestanding platforms with libc++ support.  For example, an extension in darwinKernel may say
 "UNSUPPORTED:winKernel,wellSupportedFreestandingPlatform2,wellSupportedFreestandingPlatform3".</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Pros:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<ul>
<li>Doesn't require a new lit feature<br>
</li><li>Mention freestanding by name, rather than alluding to it via hosted</li></ul>
<div>Cons:</div>
<div>
<ul>
<li>Scales poorly with the number of freestanding platforms available</li><li>Requires a lot of work from new platform authors<br>
</li></ul>
</div>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>Alternative 2:</b></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Add "negative features" to lit.  If a lit configuration has a certain negative feature, then it will only run tests that mention that feature.  For example, freestanding configurations would have the "freestanding" feature, and would only run tests that have
 the "TO_BE_DETERMINED: freestanding" annotation.  lit configurations without the "freestanding" feature (i.e. hosted implementations) would still be able to run the test.  I don't see a good way to handle vendor extensions.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Pros:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<ul>
<li> Allow-lists just the freestanding tests</li></ul>
<div>Cons:</div>
<div>
<ul>
<li>Requires a new lit feature</li><li>Doesn't handle vendor extensions<br>
</li></ul>
</div>
</div>
<br>
</body>
</html>