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

    <tr>
        <th>Summary</th>
        <td>
            Some clang driver test cases fail if the temporary lit directory contains "crt"
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            test-suite,
            clang:driver
      </td>
    </tr>

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

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

<pre>
    I just ran into this, for example:

```
--
/builddir/build/BUILD/clang-14.0.0.src/test/Driver/fuchsia.c:76:27: error: CHECK-RELOCATABLE-NOT: excluded string found in input
// CHECK-RELOCATABLE-NOT: crt{{[^.]+}}.o
                          ^
<stdin>:7:216: note: found here
 "ld.lld" "-z" "max-page-size=4096" "-z" "now" "-z" "rodynamic" "-z" "separate-loadable-segments" "-z" "rel" "--pack-dyn-relocs=relr" "-r" "--eh-frame-hdr" "-dynamic-linker" "ld.so.1" "-o" "a.out" "/tmp/lit-tmp-mrhgcrt2/fuchsia-8a32ad.o" "-r"
                                                                                                                                                                                                                       ^~~~~~~~~~~~~~~~~~~~~
Input file: <stdin>
Check file: /builddir/build/BUILD/clang-14.0.0.src/test/Driver/fuchsia.c
```

The test appears to fail only because `crt{{[^.]+}}.o` matches for `crt2/fuchsia-8a32ad.o`, which (I am pretty sure) it should not.

The failing tests in this case are for me:

```
Failed Tests (5):
  Clang :: Driver/freebsd.c
  Clang :: Driver/fuchsia.c
  Clang :: Driver/linux-cross.cpp
  Clang :: Driver/netbsd.c
  Clang :: Driver/openbsd.c
```


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzVVd1u6zYMfhrnRpDhKM7fhS_aJMWKFTvA1j0ALdG2TmXJkORz2vP0oxyn7bp2HbDdzCEkiiKpjxTF1E49Vbfs6xgi82CZttGx2OmQiQNrnGf4CP1gMFtdZcUxKy7jpphpWnI-i8VNP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