<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/91901>91901</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`update_llc_test_checks.py` crashes when trying to add checks to a newly created test file
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Poseydon42
</td>
</tr>
</table>
<pre>
The `update_llc_test_checks.py` script crashes when generating check lines for the first time if the file does not have a `; RUN ...` line at the top. The error message is below:
```
Traceback (most recent call last):
File "/home/poseydon/dev/llvm-project/./llvm/utils/update_llc_test_checks.py", line 285, in <module>
main()
File "/home/poseydon/dev/llvm-project/./llvm/utils/update_llc_test_checks.py", line 240, in main
output_type.add_checks(
UnboundLocalError: local variable 'output_type' referenced before assignment
```
Steps to reproduce:
1. Create a new `.ll` file in `llvm/test/CodeGen/X86/`
2. Add at least one function to it
3. Run `update_llc_test_checks.py --llc-binary path/to/your/built/llc llvm/test/CodeGen/X86/your_file.ll`
Can someone please confirm if this is indeed a bug or if the scripts isn't intended to be used without manually adding a `; RUN ...` line first.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VEGP2zYT_TXUZbCCREvy6qDDxht9lw9FkSZAbwZFji02FCmQw13o3xcjezdp0aS3AgZt0uTMmzfvjUrJXj3iINoPon0uVKY5xOHXkHAzwTeymILZhs8zguiqvBpFeHZOnwkTnfWM-msq1010FSQd7Uqgo0ozJnid0cMVPUZF1l9hvwvOekxwCRFoRrjYmAjILgj2cj9xCCZgAh8IZvWCoDizOHyAT19-gbIsOReHAUX7EwprCQwQYwwRFkxJXRFsggldeBWHJ1E9i-pt7ar7Z99-jkrjpPRXEPJxCYkgokZPoJVz4FQiIfv3EAAj4xNSCjnOYUEhx_VOlZCjwRchR-deloc1hj9Qk5BjeT8ScsxkXeLvH9LIgU-36uRjy7-tB3E4LcFkh-Lw8Q0HwKKsF_KR4f332Jrqjm1H8Y4pZFoznWlbsVTG3B8zyv3KFz-F7M3_g1buIzdLHJ7A8Q5eVLRq2vEfv4si5BEiXjCi12hgwkuICDfRLujpH3t6W38jXBNQgIhrDCZrfG9jXcIpoiLWlsdX1lfpHOtqlx9T3lV3XpgEIcdTMPg_ZCJ_f-yEHN-TyRKejGEtOlSJIHiES_aabPCc3d4xHkr4lP1PTQQPD87ph8l6FTdYFc2cPwg5biFHIccpW0d7yzT8HB4_OHMxt7q-5-WkPKSwIANdGTOCDv5i43LzoE1sHesNogEFU75CiG_2vHmcb3ghjwTWE3qDhiudEHJCA6-W5pAJFuWzcm4DZQwPAAU_MvI-BsrCDAfTH3pV4FAf67Zt-qqri3mou0vfaZxk01WNmrCrZaeOrWmmur802BZ2kJVsqraWspaNrMupakzXt6rr-rrvjo1oKlyUdSWzVoZ4LWxKGYe-7qu6cGpCl_YJKCXrYf-T9d4-F3HYPTPlaxJN5Wyi9C0KWXI4_Ntg_MtEpLgxGRSYlttQ3FW6K9FtoHdhGuAwuxyLHN0wE62J9StHIcerpTlPpQ7LN__-zdl7CeznvcQ_AwAA__-fZOdX">