[Lldb-commits] [PATCH] D64769: [lldb][test_suite] change the test main.cpp to avoid expression reschedule

Wanyi Ye via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 16 11:09:47 PDT 2019


kusmour added a comment.

In D64769#1587318 <https://reviews.llvm.org/D64769#1587318>, @labath wrote:

> The change is fine, but for my own education, could you elaborate on what this "delayed calculation" is, and how does it make the test fail?


The test set the breakpoint to the return statement, even thought the compiler flag `-O0` was set, the first hit to that bp showed that `g_common_1 = 0` which actually should be 21. The test assume when we hit the return statement, the value should already be calculated, but that's not the case for NDK20 clang.

So we reproduce the test manually, turned out that the value was calculated later. lldb first hit the return statement then jump back to line 20. By looking at the assembly that clang provided, it indeed jump back and forth.

It's possible that the jumping behavior is caused by optimization, considering there're some other tests having similar problem, and the behavior changed a lot from NDK 19 to 20. I made this change because this is irrelevant to testing global variables.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64769/new/

https://reviews.llvm.org/D64769





More information about the lldb-commits mailing list