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

    <tr>
        <th>Summary</th>
        <td>
            [C++20] [Modules] default -fmodule-output of partitions is inconsistent with -fprebuilt-module-path 
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

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

<pre>
    ### Example

**interface.cppm**
```cxx
export module hello:interface;
export void hello() {}
```

**hello.cppm**
```cxx
export module hello;
export import :interface;
```

**main.cpp**
```cxx
import hello;
int main() { hello(); }
```

### Problem

GCC is able to compile them in single command:
```shell
g++ -std=c++20 -fmodules-ts -x c++ interface.cppm hello.cppm main.cpp -o hello
```

But clang is **not** able to achieve by the command:
```shell
clang++ -std=c++20 -fmodule-output -fprebuilt-module-path=. interface.cppm hello.cppm main.cpp -o hello
```

### Cause
The `-fmodule-output` filename of partition `interface.cppm` is `interface.pcm` by default. (GCC & MSVC are both default to `hello-interface.gcm` / `hello-interface.ifc`). But `-fprebuilt-module-path` requires `hello-interface.pcm`.



</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVE2PtDYM_jXmYoEgDAwcOJSZTk8rVWrVewADWYWEJWE7---rANP56Oxu9eqVIj5sx3mex3a4MaJTRAUkJSRHj8-211PRz1x1b0K9CuVVuvkogMXrwl_PfBglQXiE8JftydwSytLU8pqCehyH1bb503Bd9fm8Wug86snioJtZEvYkpYb4mgHi8i7uXYtmi2IZsBxhX8L--JD9v5CWLT8K5x6CGJbXU5RfIBi4UA7A1-dvye8PFsqi236lfCsBxCV-J8GlZL9PupI03Dp_OxxQGOSVJLQaaz2Mwn32NKBQaITqJDnzwFUD8SNy45Cstg5YCaxE39gG4mO9_rIQ_XbV0_jWoH_GzYP3fYLXGuFFLPT1RvVzduVssZZcdY7Gqq7Sdv34lxave0HvhNWHY_a_6Cw5v6Pk69mOs0W_HSeqZiGtvzlGbnuIj8FPYnmt4YHPZhu6P3tCSMMHMJCG2ApJig-EusWRT1ZYoZWLfZjNNFxUu7WP9WKuPrChls_SBggsc20CLMWXP_46IJ8IK237S4RTGNJw4eBfM3VrJmCnZ17R1o4jywN0JVx4PBUxDXGit1lMZJ7lWfEGd2ItT68p4iaPc-5REaX7LM_yhEVeX-RpUld7nvAkilm0q5OspSzLmjhv-J6z1hMFC1kcxlEa7ZNsFwV1kydtnFLWRjmFKYddSAMXMpDyfQj01HnCmJmKNNolqSd5RdJcLtKpcEF-NXcGdqEUxprrNiusXK7cw6W1IDkiJOXLOjHu7yLyY8_dlta4MgpVa2WEsaQs_i1s_0lbojdPsuitHY2bAHYCduqE7ecqqPUA7OTgbS9_nPQr1RbYaaFogJ0Wlv8EAAD__8ur2vQ">