diff options
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
3 files changed, 60 insertions, 16 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/Makefile b/lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/Makefile index 1adf3fc44a6..a49ffa84c54 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/Makefile +++ b/lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/Makefile @@ -1,5 +1,5 @@ LEVEL = ../../../make CXX_SOURCES := main.cpp include $(LEVEL)/Makefile.rules -CXXFLAGS_EXTRAS := -O1 -glldb -Xclang -femit-debug-entry-values +CXXFLAGS_EXTRAS := -O2 -glldb -Xclang -femit-debug-entry-values include Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/TestBasicEntryValuesX86_64.py b/lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/TestBasicEntryValuesX86_64.py index 1192c2b672f..e0285e6d626 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/TestBasicEntryValuesX86_64.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/TestBasicEntryValuesX86_64.py @@ -6,8 +6,7 @@ supported_platforms = ["linux"] supported_platforms.extend(lldbplatformutil.getDarwinOSTriples()) lldbinline.MakeInlineTest(__file__, globals(), - [decorators.skipIf(bugnumber="llvm.org/pr44059"), - decorators.skipUnlessPlatform(supported_platforms), + [decorators.skipUnlessPlatform(supported_platforms), decorators.skipIf(compiler="clang", compiler_version=['<', '10.0']), decorators.skipUnlessArch('x86_64'), decorators.skipUnlessHasCallSiteInfo, diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/main.cpp index ff72a81c6b2..9aac6e94783 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/main.cpp @@ -18,6 +18,14 @@ template<typename T> __attribute__((noinline)) void use(T x) { /* Clobbers */ : "rsi" \ ); +// Destroy %rbx in the current frame. +#define DESTROY_RBX \ + asm volatile ("xorq %%rbx, %%rbx" \ + /* Outputs */ : \ + /* Inputs */ : \ + /* Clobbers */ : "rbx" \ + ); + struct S1 { int field1 = 123; int *field2 = &field1; @@ -30,10 +38,17 @@ void func1(int &sink, int x) { // Destroy 'x' in the current frame. DESTROY_RSI; - //% self.filecheck("image lookup -va $pc", "main.cpp", "-check-prefix=FUNC1-DESC") - // FUNC1-DESC: name = "x", type = "int", location = DW_OP_entry_value(DW_OP_reg4 RSI) + // NOTE: Currently, we do not generate DW_OP_entry_value for the 'x', + // since it gets copied into a register that is not callee saved, + // and we can not guarantee that its value has not changed. ++sink; + + // Destroy 'sink' in the current frame. + DESTROY_RBX; + + //% self.filecheck("image lookup -va $pc", "main.cpp", "-check-prefix=FUNC1-DESC") + // FUNC1-DESC: name = "sink", type = "int &", location = DW_OP_entry_value(DW_OP_reg5 RDI) } __attribute__((noinline)) @@ -43,10 +58,16 @@ void func2(int &sink, int x) { // Destroy 'x' in the current frame. DESTROY_RSI; - //% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC2-EXPR") - // FUNC2-EXPR: (int) ${{.*}} = 123 + //% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC2-EXPR-FAIL", expect_cmd_failure=True) + // FUNC2-EXPR-FAIL: couldn't get the value of variable x: variable not available ++sink; + + // Destroy 'sink' in the current frame. + DESTROY_RBX; + + //% self.filecheck("expr sink", "main.cpp", "-check-prefix=FUNC2-EXPR") + // FUNC2-EXPR: ${{.*}} = 2 } __attribute__((noinline)) @@ -69,10 +90,16 @@ void func4_amb(int &sink, int x) { // Destroy 'x' in the current frame. DESTROY_RSI; - //% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC4-EXPR", expect_cmd_failure=True) - // FUNC4-EXPR: couldn't get the value of variable x: Could not evaluate DW_OP_entry_value. + //% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC4-EXPR-FAIL", expect_cmd_failure=True) + // FUNC4-EXPR-FAIL: couldn't get the value of variable x: variable not available ++sink; + + // Destroy 'sink' in the current frame. + DESTROY_RBX; + + //% self.filecheck("expr sink", "main.cpp", "-check-prefix=FUNC4-EXPR", expect_cmd_failure=True) + // FUNC4-EXPR: couldn't get the value of variable sink: Could not evaluate DW_OP_entry_value. } __attribute__((noinline)) @@ -98,10 +125,16 @@ void func7(int &sink, int x) { // Destroy 'x' in the current frame. DESTROY_RSI; - //% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC7-EXPR") - // FUNC7-EXPR: (int) ${{.*}} = 123 + //% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC7-EXPR-FAIL", expect_cmd_failure=True) + // FUNC7-EXPR-FAIL: couldn't get the value of variable x: variable not available ++sink; + + // Destroy 'sink' in the current frame. + DESTROY_RBX; + + //% self.filecheck("expr sink", "main.cpp", "-check-prefix=FUNC7-EXPR") + // FUNC7-EXPR: ${{.*}} = 4 } __attribute__((always_inline)) @@ -129,10 +162,16 @@ void func11_tailcalled(int &sink, int x) { // Destroy 'x' in the current frame. DESTROY_RSI; - //% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC11-EXPR") - // FUNC11-EXPR: (int) ${{.*}} = 123 + //% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC11-EXPR-FAIL", expect_cmd_failure=True) + // FUNC11-EXPR-FAIL: couldn't get the value of variable x: variable not available ++sink; + + // Destroy 'sink' in the current frame. + DESTROY_RBX; + + //% self.filecheck("expr sink", "main.cpp", "-check-prefix=FUNC11-EXPR") + // FUNC11-EXPR: ${{.*}} = 5 } __attribute__((noinline)) @@ -150,10 +189,16 @@ void func13(int &sink, int x) { // Destroy 'x' in the current frame. DESTROY_RSI; - //% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC13-EXPR") - // FUNC13-EXPR: (int) ${{.*}} = 123 + //% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC13-EXPR-FAIL", expect_cmd_failure=True) + // FUNC13-EXPR-FAIL: couldn't get the value of variable x: variable not available - ++sink; + use(sink); + + // Destroy 'sink' in the current frame. + DESTROY_RBX; + + //% self.filecheck("expr sink", "main.cpp", "-check-prefix=FUNC13-EXPR") + // FUNC13-EXPR: ${{.*}} = 5 } __attribute__((noinline, disable_tail_calls)) |