<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/66625>66625</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Runtime Error when using mlir-opt tool
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
SwapnilGhanshyala
</td>
</tr>
</table>
<pre>
When building MLIR project with option -DLLVM_USE_SANITIZER="Address;Undefined", we face the following error.
```$ build/bin//mlir-opt --help
~/llvm-project-public/llvm/include/llvm/Support/CommandLine.h:588:13: runtime error: load of value 1, which is not a valid value for type 'const (anonymous namespace)::TestOptionsPass::Enum'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ~/llvm-project-public/llvm/include/llvm/Support/CommandLine.h:588:13 in
```
The error goes away if we compile without sanitizers.
The first commit to introduce this issue is 710b5a12324e54d42632985c46a3071fc2504fc9 (@chsigg )
The cmake command with sanitizer is :
```
cmake -G Ninja ../llvm -DLLVM_ENABLE_PROJECTS=mlir -DLLVM_BUILD_EXAMPLES=ON -DLLVM_TARGETS_TO_BUILD="host" -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_ENABLE_LLD=ON -DLLVM_CCACHE_BUILD=ON -DLLVM_USE_SANITIZER="Address;Undefined" -DMLIR_INCLUDE_INTEGRATION_TESTS=ON
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VM-PqzYQ_mucyygR2JCEAwcSyDZtfqwC277XS2TABL8aG2Gz0fbQv70ykN3X7Tv0UimKhD975ptvZj6qNb9JxkLkb5Afz2hvatWF6Z22kounmkpdv1FBZ7kq38LfaiYh77koubzB8bC_QNupb6wwcOemBtUariTM48Ph1-P1JU2uaXTaZ_vfkwsiMcI4KsuOaY3I5kWWrOKSlQh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