From 00cc735a6f443cec8d9fcd3d64ae8d10a7caaae0 Mon Sep 17 00:00:00 2001 From: Adrian McCarthy Date: Mon, 26 Feb 2018 21:22:39 +0000 Subject: [PATCH] Partial fix for TestConflictingSymbol.py on Windows Without this fix, the test ERRORs because the link of the inferior fails. This patch adds the LLDB_TEST_API macro where needed and uses the new -2 magic value for num_expected_locations to account for lazy-loading of module symbols on Windows. With this fix, the test itself still fails: conflicting_symbol isn't in the debug info nor the export table, and Windows binaries don't have an equivalent of the ELF .symtab. We need to understand why the test works to keep the symbol out of the debug info. In the mean time, having the test fail at this point is a better indication of the remaining problem than a build error. Differential Revision: https://reviews.llvm.org/D43688 llvm-svn: 326130 --- .../Python/lldbsuite/test/lang/c/conflicting-symbol/One/One.h | 2 +- .../test/lang/c/conflicting-symbol/TestConflictingSymbol.py | 4 ++-- .../Python/lldbsuite/test/lang/c/conflicting-symbol/Two/Two.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One/One.h b/lldb/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One/One.h index b59f5ad13f22..aae27571bb9c 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One/One.h +++ b/lldb/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One/One.h @@ -1,4 +1,4 @@ #ifndef ONE_H #define ONE_H -void one(); +LLDB_TEST_API void one(); #endif diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py b/lldb/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py index 0fbf6725695f..67bd71b34c3e 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py +++ b/lldb/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py @@ -33,9 +33,9 @@ class TestConflictingSymbols(TestBase): target, ['One', 'Two']) lldbutil.run_break_set_by_source_regexp(self, '// break here', - extra_options='-f One.c') + extra_options='-f One.c', num_expected_locations=-2) lldbutil.run_break_set_by_source_regexp(self, '// break here', - extra_options='-f Two.c') + extra_options='-f Two.c', num_expected_locations=-2) lldbutil.run_break_set_by_source_regexp(self, '// break here', extra_options='-f main.c', num_expected_locations=1) diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two/Two.h b/lldb/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two/Two.h index 8d5bd6a32330..450fe5a3551f 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two/Two.h +++ b/lldb/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two/Two.h @@ -1,4 +1,4 @@ #ifndef TWO_H #define TWO_H -void two(); +LLDB_TEST_API void two(); #endif