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

    <tr>
        <th>Summary</th>
        <td>
            aarch64-unknown-nto-qnx8.0.0 causes err_drv_triple_version_invalid error
        </td>
    </tr>

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

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

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

<pre>
    Parsing the environment version fails for triple `aarch64-unknown-nto-qnx8.0.0` which causes `err_drv_triple_version_invalid`. 

Clang assumes `unknown` as the environment instead of `qnx` because `qnx`is not mapped in the [EnvironmentType](https://github.com/llvm/llvm-project/blob/098b0d18add97dea94e16006486b2fded65e228d/llvm/include/llvm/TargetParser/Triple.h#L243) enum. This causes [VersionTuple::tryParse](https://github.com/llvm/llvm-project/blob/bd9145c8c21334e099d51b3e66f49d51d24931ee/llvm/lib/Support/VersionTuple.cpp#L63) to fail.

```json
  "diagnostics": [
      {
 "code": "drv_triple_version_invalid",
        "message": "Version 'qnx8.0.0' in target triple 'aarch64-unknown-nto-qnx8.0.0' is invalid",
 "range": {
          "end": {
            "character": 0,
            "line": 0
          },
          "start": {
 "character": 0,
            "line": 0
          }
 },
        "relatedInformation": [],
        "severity": 1,
 "source": "clang"
      },
]
```






</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVFFv4zYM_jXyi1BDom3ZfvBDe1mAAXsYsGKvhSwxtm625JPk9PrvBzlpk9y1BYZdEDixRH7kR36kDMEMFrEj1QOpdplc4-h8N7vVRrRZ7_RL96f0wdiBxhEp2qPxzs5oIz2iD8ZZepBmCvTgPI3eLBNSIpiUXo2ivFvtP9Y92zsb3d03-73JWc6IYPR5NGqkSq4BQ7JH75-0Pz6dEJ7O0E_GHuVkNBEsp4TtCLs_Pb9M0g5UhrDOJ_9znAQtw0-ZGhsiSk3dIdl-s9-TXY9b-MuJCdS6SGe5LKipsRsMqR5-uyA9vixIqh2BZoxxCaS4J7AnsB9MHNc-V24msJ-m4-vP3eLdV1SRwL6fXE9gz9qmZ5o3Uuu21ijbErlgTJSN6OGgUYsKARp9wTFWTavGy8Gj9APG1BX06XUrWT4SKP6AsiDQUrTrnNPH0YS3ElcPf59q-rguE6bEi_voXzaU_8eo1y0vK9Uo4EVRImtbXfG-QCEOZfqroWwLjlcEJpP8_lqXxfkEdJ1ZrpYlMREbkeg2deXXvSeCnb5fg7OnI0oJgDZysC5EowIBIMV9Iv16nz6kfn0lAMqlkp7MAD6RHgCBL9cwW7AZQ5DDFcKZAyVQv-kc6k1FW7veZgPqT2cj-QT6XnAC4KW9xKwfbrPa8kKrP77fLNQovVQxSWezYz_ROxtOxuKbzY-R6t07bgQgRJla-kMGvzLsGfGdBFKBcJIR9e_24Pwso3H2SgrVuy4Bj-hNfDkb8puCB7d6ddVllfZOer2R1QU3xbgV6Y1yP3hmuit0W7Qyw47XBRdtA5xlY4dtI0XJFLRK9o0WUkhgjRYFaslqKDPTAYOSc17xlouyzQ91garpiwPjB8mEJCXDOU1QGr3c-SEzIazYcS5KKLJJ9jiFbfkDWHym220iWO0y320D369DICWbTIjhAhNNnLD7TMqvq-fz1Z6unc9WP3X_eQFtyQYC-zObYwf_BgAA__-SXvyA">