<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/67970>67970</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
The behavior of `__builtin_assume`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
YangChenyuan
</td>
</tr>
</table>
<pre>
Hi, I am not sure about the behavior of `__builtin_assume`.
I have this file with a wrong `__builtin_assume` that `A != 10` (actually `A` is 10)
```cpp
#include <iostream>
int main(){
int A = 10;
int B = 0;
int C = A + B;
std::cout << C << std::endl;
__builtin_assume(A != 10);
return C;
}
```
When I compile this file with ` clang++ -O3 file.cpp -o exx` and execute `exx`, its output will be
```
10
10
[1] segmentation fault ./exx
```
I am curious whether such behavior is expected and why there are two `10` are printed.
Thanks in advance
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMU02P6zYM_DXyhdhAlhwnPviQjwbdUy8PKHpayDJjqZUlw6I2u_--kBM0H8UDHhBExoxIDqmhitEOHrFl6z1bHwuVyIS5_Uv54WDQfyfliy703-3vlokDvIMawQeCmGYE1YVEQAahQ6M-bZghnIHV_OOjS9aR9R8qxjQiq_mK8SPju-v_Oxj1iUDGRjhbh3CxZEDBZQ5--EkCIKMocztgomTyCCXPMBNbpSkp574XNmM2ZlI0t5o1v_70NN0QIa3XLvUITB5siDSjGpn87VGk9QSjsp6JbU612V9hAIBM7eCmQb4Q-4W44zc2U4eFyg3sYf8UGKlncsfkTueRMnlg8rBcXz7-Y9H37inuf4MS28f5iObp9oyUZg-Hu7bN8WVGj5r_NOjhHXQYp_xIL8-VB62d8gMT-9zQ2x9yYVd6muAtAH595SvK94BfqBNhDrmi2UuWIoREUyK4WOegQ3gs_qKofDnZel-y9REg4jCiJ0U2eDir5AhgxcQpF_p5a4uRdZptSBEuBsngDDFpc7eyjYBfE2rCfmniYr6z17PvZwS6hNzO1YMZmGbrCfsnn_8wyv8TwXpQ_afyGou-lX0jG1VgW9ZNLapqW1eFaYUUa6H7dV_WWpx5Xzfbptdcb7rNtlOVLmwruJAl56Is-aaqVlKoNZfirFTd8Fo1rOI4KutWzn2OqzAPhY0xYVtvmg0vnOrQxWXLhfB4gYVkQuSln9sc89alIbKKOxsp3rOQJYftj19a8iLNrjVEU8x2FScmToMlk7qVDiMTp5z0drxNc_gbNTFxWqREJk6L1H8DAAD__4T7VOE">