<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/56155>56155</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
lldb prints wrong value for -O1
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
yangyibiao
</td>
</tr>
</table>
<pre>
$ clang --version
```
Ubuntu clang version 15.0.0-++20220609064141+23db8e4b4322-1~exp1~20220609184229.542
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
```
$ lldb --version
`lldb version 15.0.0`
$ cat small.c
```
void foo(int *a) { (*a)++; }
int main ()
{
int a = 0;
foo (&a);
return 0;
}
```
$ clang -g -O1 small.c; lldb a.out
```
(lldb) target create "a.out"
Current executable set to '/root/DeVIL/a.out' (x86_64).
(lldb) b 7
Breakpoint 1: where = a.out`main at small.c:7:3, address = 0x0000000000000610
(lldb) r
Process 48655 launched: '/root/DeVIL/a.out' (x86_64)
Process 48655 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
frame #0: 0x0000555555554610 a.out`main at small.c:7:3
4 {
5 int a = 0;
6 foo (&a);
-> 7 return 0;
8 }
(lldb) fr var
(int) a = 0
(lldb)
```
We can found that, lldb prints `a = 0`. I was wondering that the correct output should be `a = 1`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNVMlu2zAQ_Rr6QkigSK0HHZw4BQIUaA9djgUpMbZaWhS4xM7fdyhKsZulrUBts7-ZRwrdP7WI5rhTfNzjJHmUxg56RGSHyBaVZFnz71fhR-cX08UQZ0VKUpIgegOLEkpJSRpS5lmeBQHrRS1zkTNKkwxVd_I8hddqmNU5pU1a5DSm-MLNXjrEtvhclz_KPJm6RA2jPyf70S8mByN5j4-6lyoYTtoO56i6H63jSsl-N5igQvSDtwaeYngbUUCuVC_eAD6L_wR5cXt27rjD9gg50-7NBI966PGD1ojWw-igoC1HtMGouoHvevmNvUMMZNXuOkNwOfJhjLbNoqpu4gfGQc8xYjtMwHuVQrroUM7BLwojnTfjle0l3Yu2XPBFWsD6lD0DhULn7vBUe_dOX-tgEaC6eaK4g6E5CXXR6EWXgd96YyTAkGfZeceFktiCuQsQKpic0RqMP-zkt_uP8F6cqwAwMgRypK-SClxF2Q2k_TXp0KgsMOJ0kEbOHYuRSjL392qKbFvBzRC9xbzvjbQ2NvhMrq8ye43URMlno7vglddlUWDF_dgdZB_p-L-I3opknZ4mCLSk3WIXNwKiLAvVjvwYkUGwNWiQBz8YPbfA46AWVy1Js5UbQBszB6CMhFoj3mK5csD7z46tkXK4EWmueIqLKHqPsbhc9e9wN0HsDler0Sseg6Jek-5ezeXB4EdunsVQQpCuVbyw_st--C5hu49Qoh97aD53obvzRpgMBAWelGSNWpIU43t84haf9NhLMNjPPvCAMBpI3zkM_Zw8NPKgveqxkJcI2Rxh07esb1jDN25wSrbXyU5Gh1OYKy-hJBM26MYb1R6cmyzMA6gFaz-4gxdpp4_wo9Tj-komo39CCfA7WOulhY-izIpic2gzIRl5YGVDaNNXlJC6qeESsiCNJEW-UVxIZVtUwLFFR3nCc4iwpYvdZmjj2Q43I4xVKSdEZA9FIZq8q4HJKCcSKKTSUEeqzX5j2rkk4fcWlGqwzl6U3NphP0o5p4P43LuDNu0TnEtPgxi43szZ27n63wcF3e8">