<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/102265>102265</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Lit's XFAIL inputs can't handle nested test cases in unit tests
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          kendalharland
      </td>
    </tr>
</table>

<pre>
    Unit tests such as [this one](https://github.com/swiftlang/llvm-project/blob/00672a8cf6754871c5f3568ba040c9a0167d5522/lldb/unittests/Symbol/TestSwiftASTContext.cpp#L234) from the downstream `swiftlang/llvm-project` repo can't be marked as XFAIL using lit's `--xfail` flag and `LIT_XFAIL` env var. 

If these tests are run, the final lit summary output says that these tests failed:

```
lldb-unit :: Symbol/./SymbolTests.exe
lldb-unit :: Symbol/ClangArgs/UniquingCollisionWithAddedFlags
lldb-unit :: Symbol/ClangArgs/UniquingCollisionWithExistingFlags
lldb-unit :: Symbol/TestSwiftASTContext/ApplyWorkingDir
lldb-unit :: Symbol/TestSwiftASTContext/PluginPath
```

These are all the same test: The actual test is `lldb-unit :: Symbol/./SymbolTests.exe` and it _can_ be marked as XFAIL using the CLI flag or env var, because it exists by the time lit attempts to mark the list of discovered tests as XFAIL.  But the last four are test cases inside SymbolTests.exe and lit doesn't know about them until after SymbolTests.exe runs and fails, at which point the `googletest` module reads them from the gtest json file and registers them as failures.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVU1v2zgQ_TX0ZRCDpizZPujgJmsgQA4FkqJ7C0bSSGJDkVoOmcT_fkHK9X603U_AEGCS82bmvcchMuvBEtWi_CDKuxXGMDpfv5Dt0IzoDdpu1bjuXH-yOkAgDgwc2xGQQZQfwqgZnCVR3gm1H0OYWRRHoU5CnQYdxtisWzcJdeI33QeDdhDqZMzrdDN794XaINSpMa4R6iRltVO4b_t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