<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63721>63721</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[HLSL] Crash on empty input
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
bogner
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
bogner
</td>
</tr>
</table>
<pre>
I was trying to work out how dxil triples work and hit an assert immediately.
Reproduce with `./bin/clang -target dxil--shadermodel6.0-compute -x hlsl /dev/null -o /dev/null`
```
Assertion failed: (EntryList.size() == 1 && "non-lib profiles should only have one entry"), function createEntryMD, file DXILMetadata.cpp, line 296.
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: ./bin/clang -target dxil--shadermodel6.0-compute -x hlsl /dev/null -o /dev/null
1. <eof> parser at end of file
2. Code generation
3. Running pass 'DXIL Metadata Emit' on module '/dev/null'.
#0 0x0000000105d97390 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/Users/bogner/code/llvm.org/build-hlsl/bin/clang-17+0x1013ff390)
...
#8 0x0000000108b6beec llvm::dxil::createEntryMD(llvm::Module&, unsigned long long) (.cold.3) (/Users/bogner/code/llvm.org/build-hlsl/bin/clang-17+0x1041d3eec)
#9 0x00000001049bbe28 llvm::dxil::createEntryMD(llvm::Module&, unsigned long long) (/Users/bogner/code/llvm.org/build-hlsl/bin/clang-17+0x100023e28)
#10 0x00000001049c3744 (anonymous namespace)::DXILTranslateMetadata::runOnModule(llvm::Module&) (/Users/bogner/code/llvm.org/build-hlsl/bin/clang-17+0x10002b744)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0Vc1u4zYQfhr6MrBAkbYsHXzQxhG6QIIGmy3QW0GRY4kNRQr8ieM-fUHZxiZFT4usYdgCh-Z8fx6KEPRgEfdk-4Uw1rvB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