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

    <tr>
        <th>Summary</th>
        <td>
            Assertion failure with ARC targets in little endian mode
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          cov-tprince
      </td>
    </tr>
</table>

<pre>
    Clang 16 introduces an assertion failure for MetaWare ARC targets in little-endian mode. The assertion appears to relate to setting up the target and so is trivially reproducible.

```
$ cat test.c
$ /opt/pkg/clang-16/bin/clang -target arc-unknown-linux-gnu -EL -c test.c
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /opt/pkg/clang-16/bin/clang -target arc-unknown-linux-gnu -EL -c test.c
1.      Compilation construction
#0 0x0000556ddf2c9b68 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/pkg/clang-16/bin/clang+0x3103b68)
#1 0x0000556ddf2c7aae llvm::sys::RunSignalHandlers() (/opt/pkg/clang-16/bin/clang+0x3101aae)
#2 0x0000556ddf2ca1ed SignalHandler(int) Signals.cpp:0:0
#3 0x00007f989cb9d980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
#4 0x00007ffcfc9e3570 
Segmentation fault
$
```

It would appear that `llvm::Target::getLittleEndianArchVariant` needs to be updated to handle ARC targets.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VE2P4zYM_TXKhYihyLFjH3zIzk7QAltgsTtojwNaZmx1FMmQqPn494WVZGZ2O4e2QINEkWiLfHwkH8ZoRkfUieqTqD6vMPHkQ6f945rnYJymVe-Hl-7GohthU4NxHPyQNEVABxgjBTbewRGNTYHg6AP8Rox_YCDYf7sBxjASRzAOrGG2tCY3GHRw8gMVcDfROy84z4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