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

    <tr>
        <th>Summary</th>
        <td>
            Some libc++ tests are (too?) big and could benefit from splitting
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc++
      </td>
    </tr>

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

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

<pre>
    I tried running the libcxx testsuite with a 32 bit Clang build, and all tests (except ones that are XFAILed for other reasons) ran successfully except for `std/algorithms/alg.modifying.operations/alg.transform/ranges.transform.pass.cpp`, which errors out due to Clang running out of memory.

The issue can be measured and quantified by taking the preprocessed output for this testcase and compiling with a build of Clang that succeeds in building it, and running e.g. this:

```
/usr/bin/time -v clang++ -c -w ranges-transform-preproc-i686.cpp -std=c++2b
        Command being timed: "bin/clang -target i686-w64-mingw32 -c -w ranges-transform-preproc-i686.cpp -std=c++2b"
        User time (seconds): 171.98
        System time (seconds): 9.82
        Percent of CPU this job got: 99%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 3:02.00
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 3081204
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 0
        Minor (reclaiming a frame) page faults: 1209752
        Voluntary context switches: 1
        Involuntary context switches: 18024
        Swaps: 0
        File system inputs: 0
        File system outputs: 69240
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 0
```

This shows that this individual compilation job used at most 3081204 KB of memory, i.e. 2.9 GB - which is too much for a 32 bit compiler. The compilation also took 3 minutes on this particular machine.

Thus, this test could benefit from splitting into smaller pieces with smaller memory usage. That would probably also be beneficial for test throughput when the tests are run in parallel.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.ll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