Commit Graph

615 Commits

Author SHA1 Message Date
Todd Fiala 94eb010fe9 Add "-gmodules" support to the test suite.
This change adds the capability of building test inferiors
with the -gmodules flag to enable module debug info support.
Windows is excluded per @zturner.

Reviewers: granata.enrico, aprantl, zturner, labath

Subscribers: zturner, labath, lldb-commits

Differential Revision: http://reviews.llvm.org/D19998

llvm-svn: 270848
2016-05-26 13:57:03 +00:00
Pavel Labath 0314b00daa Avoid using stdio in TestVirtual
Summary:
using stdio in tests does not work on windows, and it is not completely reliable on linux.
Avoid using stdio in this test, as it is not necessary for this purpose.

Reviewers: clayborg

Subscribers: lldb-commits, zturner

Differential Revision: http://reviews.llvm.org/D20567

llvm-svn: 270831
2016-05-26 08:38:02 +00:00
Enrico Granata fee0aba006 It has been brought to my attention that, given two variables
T x;
U y;

doing

x = *((T*)y)

is undefined behavior, even if sizeof(T) == sizeof(U), due to pointer aliasing rules

Fix up a couple of places in LLDB that were doing this, and transform them into a defined and safe memcpy() operation

Also, add a test case to ensure we didn't regress by doing this w.r.t. tagged pointer NSDate instances

llvm-svn: 270793
2016-05-25 23:19:01 +00:00
Omair Javaid 1b356bf898 Mark some aarch64-linux specific xfails marking bug entries
TestBSDArchives.py and TestWatchLocation.py fail due to unicode error and bug has already been reported for arm and macOSx.

TestConstVariables.py fails because lldb cant figure out frame variable type when used in expr.

llvm-svn: 270780
2016-05-25 22:30:05 +00:00
Enrico Granata f02be230f6 Fix an issue where LLDB would crash if one tried to 'frame variable' an unordered_map more than once in a stop due to the synthetic provider not properly caching the ValueObjects it was returning for the child elements
Fixes rdar://26470909

llvm-svn: 270752
2016-05-25 20:38:33 +00:00
Omair Javaid 0d435b6933 Mark some arm-linux specific xfails marking bug entries
TestCallUserAnonTypedef.py and TestIRInterpreter.py fail to limitation of JIT expressions in handling hard float ABI targets.
TestBSDArchives.py fails due to python unicode error.
TestBuiltinTrap.py fails due to wrong line information generated by some gcc versions.

llvm-svn: 270745
2016-05-25 18:48:39 +00:00
Ed Maste dfbdf80962 xfail TestRedefinitionsInline with older Clang
This fails on FreeBSD 10 with the system compiler, Clang 3.4.1.

llvm.org/pr27845

llvm-svn: 270603
2016-05-24 19:51:11 +00:00
Chaoren Lin 1245c2b39b Make sure TestRedefinitionsInInlines.py actually inlines.
Reviewers: spyffe

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D20540

llvm-svn: 270493
2016-05-23 21:44:34 +00:00
Zachary Turner 76f3def58a xfail TestRedefinitionsInline on Windows.
llvm-svn: 270490
2016-05-23 21:22:11 +00:00
Sean Callanan 5ba3215fe3 Removed the m_decl_objects map from ClangASTContext.
m_decl_objects is problematic because it assumes that each VarDecl has a unique
variable associated with it.  This is not the case in inline contexts.

Also the information in this map can be reconstructed very easily without
maintaining the map.  The rest of the testsuite passes with this cange, and I've
added a testcase covering the inline contexts affected by this.

<rdar://problem/26278502>

llvm-svn: 270474
2016-05-23 18:30:59 +00:00
Zachary Turner fa7f948237 Always rerun all tests on Windows.
There is flakiness somewhere in the core infrastructure on Windows,
so to get the buildbot reliably green we need to mark all tests
as flaky.

llvm-svn: 270460
2016-05-23 17:32:04 +00:00
Kuba Brecka 52ded8072a Reword ThreadSanitizer message for invalid mutex reports.
llvm-svn: 270364
2016-05-22 14:32:45 +00:00
Jim Ingham 906d91e762 Fix error propagation from the Z0 packet in gdb-remote breakpoint setting.
The error was not getting propagated to the caller, so the higher layers thought the breakpoint
was successfully set & resolved.

I added a testcase, but it assumes 0x0 is not a valid place to set a breakpoint.  On most systems
that is true, but if it isn't true of your system, either find another good place and add it to the
test, or x-fail the test.

<rdar://problem/26345962>

llvm-svn: 270014
2016-05-19 02:13:44 +00:00
Omair Javaid bc782a866b xfail TestTopLevelExprs for arm and aarch64 linux
TestTopLevelExprs fails on arm and aarch64 linux similar to behaviour on android.
A bug exists here: llvm.org/pr27787. 

This patch marks xfail on arm and aarch64.

llvm-svn: 269980
2016-05-18 20:45:12 +00:00
Omair Javaid c675cfa8a9 xfail TestWatchLocation.py for arm-linux targets
TestWatchLocation.py fails on arm-linux target due to unicode error in lldb testsuite.
This is a known issue and same test fails on OS X with similar reason.
I have reported a bug and marked this test as xfail for arm-linux targets.

llvm-svn: 269860
2016-05-17 23:01:56 +00:00
Zachary Turner 8d4d151bb2 Allow custom formatting of session log file names.
Differential Revision: http://reviews.llvm.org/D20306

llvm-svn: 269793
2016-05-17 18:02:34 +00:00
Tamas Berghammer 75f8f6e111 xfail TestTopLevelExprs for Android API 21-22 (llvm.org/pr27787)
llvm-svn: 269759
2016-05-17 12:42:25 +00:00
Sean Callanan 84fee5852c Fixed and re-enabled the Clang modules testcase.
Macros work again after Clang r269554.  This testcase just needed some small
tweaks to get it going again.

llvm-svn: 269704
2016-05-16 21:11:21 +00:00
Sean Callanan da255efa2a Test diamond virtual inheritance in top-level expressions.
llvm-svn: 269698
2016-05-16 20:55:10 +00:00
Enrico Granata 429e1f9b1d Make LLDB print out an explicit marker when it's displaying formatters that are part of a disabled category
Fixes rdar://26202006

llvm-svn: 269673
2016-05-16 17:27:26 +00:00
Omair Javaid 32558a1615 Xfail TestCrashDuringStep and TestCreateDuringInstructionStep on arm-linux
Both of above tests fail on arm and bugs have been reported on android already.
Adding arm-linux decorator because android decorator doesnt xfail these test when run on linux. 

llvm-svn: 269647
2016-05-16 11:21:49 +00:00
Saleem Abdulrasool 0eadc53f6d test: remove use of undefined variables
The variables referenced in the print message are not defined.  Simply state
that the requisite script is not found.  Correct grammar to indicate that the
tests are rather likely to fail rather than unlikely to fail.

llvm-svn: 269628
2016-05-16 03:13:12 +00:00
Saleem Abdulrasool c0d0e36197 test: add missing splat
The parameter here is a list, not a string.  Ensure that the we splat the list
into arguments prior to invoke os.path.join.  This would previously fail with a
`startswith` is not a member of `list`.

llvm-svn: 269627
2016-05-16 03:13:08 +00:00
Saleem Abdulrasool 81eadde6ca test: add missing parameter
Add the missing required parameter to the function.  This permits tests to get a
bit further before failing.

llvm-svn: 269626
2016-05-16 03:13:05 +00:00
Todd Fiala 4728cf7e85 surface build error content through test event system
Summary:
print build errors nicely in test output

This test infrastructure change adds a new Python exception
for test subject builds that fail.  The output of the build
command is captured and propagated to both the textual test
output display code and to the test event system.

The ResultsFormatter objects have been modified to do something
more useful with this information.  The xUnit formatter
now replaces the non-informative Python build error stacktrace
with the build error content.  The curses ResultsFormatter
prints a 'B' for build errors rather than 'E'.

The xUnit output, in particular, makes it much easier for
developers to track down test subject build errors that cause
test failures when reports come in from CI.

Reviewers: granata.enrico

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D20252

llvm-svn: 269525
2016-05-14 00:42:30 +00:00
Todd Fiala 7c5f7caa20 test infra: catch bad decorators and import-time errors
Summary:
This change enhances the LLDB test infrastructure to convert
load-time exceptions in a given Python test module into errors.
Before this change, specifying a non-existent test decorator,
or otherwise having some load-time error in a python test module,
would not get flagged as an error.

With this change, typos and other load-time errors in a python
test file get converted to errors and reported by the
test runner.

This change also includes test infrastructure tests that include
covering the new work here.  I'm going to wait until we have
these infrastructure tests runnable on the main platforms before
I try to work that into all the normal testing workflows.

The test infrastructure tests can be run by using the standard python module testing practice of doing the following:

cd packages/Python/lldbsuite/test_event
python -m unittest discover -s test/src -p 'Test*.py'

Those tests run the dotest inferior with a known broken test and verify that the errors are caught.  These tests did not pass until I modified dotest.py to capture them properly.

@zturner, if you have the chance, if you could try those steps above (the python -m unittest ... line) on Windows, that would be great if we can address any python2/3/Windows bits there.  I don't think there's anything fancy, but I didn't want to hook it into test flow until I know it works there.

I'll be slowly adding more tests that cover some of the other breakage I've occasionally seen that didn't get collected as part of the summarization.  This is the biggest one I'm aware of.

Reviewers: zturner, labath

Subscribers: zturner, lldb-commits

Differential Revision: http://reviews.llvm.org/D20193

llvm-svn: 269489
2016-05-13 21:36:26 +00:00
Zachary Turner 4fd6a96008 Clean up test results on Windows.
Remove XFAIL from some tests that now pass.
Add XFAIL to some tests that now fail.
Fix a crasher where a null pointer check isn't guarded.
Properly handle all types of errors in SymbolFilePDB.

llvm-svn: 269454
2016-05-13 18:26:30 +00:00
Greg Clayton ff8e6a763f Fix libstdc++ failure where <atomic> is not able to be imported on Darwin systems.
The adding of <atomic> to test_common.h broke 12 tests on Darwin. We work around this by not including <atomic> when building on darwin for libstdc++ tests.

llvm-svn: 269372
2016-05-12 22:33:02 +00:00
Cameron Desrochers 739fc77c01 Added missing makefile from patch D19124 (should fix the corresponding commit rL269340)
llvm-svn: 269366
2016-05-12 22:10:16 +00:00
Marianne Mailhot-Sarrasin 3fe7158174 [LLDB] Added support for PHI nodes to IR interpreter
This allows expressions such as 'i == 1 || i == 2` to be executed using the IR interpreter, instead of relying on JIT code injection (which may not be available on some platforms).

Patch by cameron314

Differential Revision: http://reviews.llvm.org/D19124

llvm-svn: 269340
2016-05-12 20:00:53 +00:00
Omair Javaid 86e0dd5c1c Xfail failing watchpoint tests on aarch64-linux
Some watchpoint tests fail on aarch64-linux as it lacks support for intalling watchpoints which are not alligned at 8bytes boundary.

Marking them as xfail for now. 

llvm-svn: 269187
2016-05-11 13:57:20 +00:00
Ravitheja Addepally b2ba5a5467 Rewriting TestMultithreaded.py to solve flakyness on Linux
Summary:
test_listener_event_process_state checks for Threads
and Frames in the multithreaded_queue. The listener_func has
more computational load, which may be latter executed than the
pop leading to the failure. This patch tries to only check for
frames in listener_func as presence of frames also confirms 
prescence of threads and avoids the second push into the 
multithreaded_queue.

Reviewers: lldb-commits, clayborg, labath

Differential Revision: http://reviews.llvm.org/D20091

llvm-svn: 269168
2016-05-11 09:54:41 +00:00
Omair Javaid e94459fa6c Corrected aarch64 register no in TestBreakpointConditions.py
Test uses x1 in breakpoint expression while objdump shows that x1 is never used in the code and may have random values.
Using x0 make sure that we are using a registe that will have a positive value and breakpoint expression will evaluate true atleast once.

llvm-svn: 269164
2016-05-11 09:29:14 +00:00
Pavel Labath ebc7135f8e Fix race in TestExitDuringStep and unify pseudo_barrier handling
Summary:
TestExitDuringStep was very rarely hanging on the buildbots. I can't be sure, but I believe this
was because of the fact that it declared its pseudo_barrier variable as "volatile int", which is
not sufficient to guarantee corectness (also, all other tests used atomic variables for this, and
they were passing reliably AFAIK). Besides switching to an atomic variable in this test as well,
I have also took this opportunity to unify all the copies of the pseudo_barrier code to a single
place to reduce the chance of this happening again.

Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D20065

llvm-svn: 269025
2016-05-10 07:54:25 +00:00
Jim Ingham 958faec74f Add a testcase for "BreakpointSetBySourceRegex"
This tests both that we set the breakpoint on the right line, and that restricting by file
and/or the function, we get the right breakpoints.

llvm-svn: 269004
2016-05-10 01:52:44 +00:00
Sean Callanan e402e56492 Added a testcase that verifies that multiline expressions work.
llvm-svn: 268971
2016-05-09 21:14:18 +00:00
Pavel Labath b5935bfd7d Mark TestPrintStackTraces as flaky on linux
PR27687

llvm-svn: 268934
2016-05-09 16:59:29 +00:00
Pavel Labath 1dfd5b1694 Enable NamespaceLookupTestCase.test_scope_lookup_before_using_with_run_command on linux
test appears to be passing now.

llvm-svn: 268923
2016-05-09 14:43:22 +00:00
Todd Fiala 57a4e5b3d0 Fix TestEvents.py on OS X
This change addresses a hang/segfault in TestEvents.py. The threads that
run the listener loops now do an SBListener.Clear() before they wrap up
their work. This prevents the test from trying to clean up the
SBListener too late.

There is a separate issue here which is that we should prevent this
clean-up time lock-up, but that is out of scope for this particular
change. I'd like to get these tests back and running the normal flow
rather than skipping them.

This addresses:
llvm.org/pr25924 (at least, the OS X side, although I suspect this will
also address Linux)

http://reviews.llvm.org/D19983
reviewed by: Jim Ingham

llvm-svn: 268653
2016-05-05 17:48:14 +00:00
Todd Fiala bcab6484eb fix argument usage for '-#' command line option
This was broken in the grand configuration change.  Now
using -# works again.

llvm-svn: 268638
2016-05-05 16:01:15 +00:00
Pavel Labath bb06ffaff3 Downgrade skip to xfail in TestBitfields on linux
the test should no longer crash, but we need to investigate why ToT clang still generates debug
info we don't understand.

llvm-svn: 268619
2016-05-05 09:03:22 +00:00
Pavel Labath c4f309a6bd Fix syntax errors in TestEnumTypes
llvm-svn: 268616
2016-05-05 08:33:56 +00:00
Pavel Labath b9436bd493 Fix DW_AT_specification handling in DWO files
Summary:
We were trying to get a DWARFDIE from a CompileUnit belonging to a DWO file. However, this
function does not understand the die encoding used by the DWO files. Instead use GetDIE on the
SymbolFileDWARF, which is overriden in DWO to do the right thing.

Reviewers: clayborg, tberghammer

Subscribers: lldb-commits, ovyalov

Differential Revision: http://reviews.llvm.org/D19927

llvm-svn: 268615
2016-05-05 08:21:44 +00:00
Adrian McCarthy 68695b643d XFail TestEnumTypes.py on Windows
Differential Revision: http://reviews.llvm.org/D19943

llvm-svn: 268574
2016-05-04 23:33:19 +00:00
Adrian McCarthy 3f99810787 XFail TestLambdas.py on Windows after fixing some of the problems
1. Fixed semicolon placement in the lambda in the test itself.

2. Fixed lldbinline tests in general so that we don't attempt tests on platforms that don't use the given type of debug info. (For example, no DWO tests on Windows.) This fixes one of the two failures on Windows. (TestLambdas.py was the only inline test that wasn't XFailed or skipped on Windows.)

3. Set the error string in IRInterpreter::CanInterpret so that the caller doesn't print (null) instead of an explanation. I don't entirely understand the error, so feel free to suggest a better wording.

4. XFailed the test on Windows. The interpreter won't evaluate the lambda because the module has multiple function bodies. I don't exactly understand why that's a problem for the interpreter nor why the problem arises only on Windows.

Differential Revision: http://reviews.llvm.org/D19606

llvm-svn: 268573
2016-05-04 23:32:35 +00:00
Sean Callanan c6b688a81b Added a testcase for the ptr_refs tool so we catch if it stops working.
llvm-svn: 268433
2016-05-03 20:36:06 +00:00
Francis Ricci 3cf8e16f44 Split out console and file writing cases in TestCommandScriptImmediateOutput
Summary:
As these are really testing separate issues, they should be run as separate
tests.

Reviewers: zturner, granata.enrico, clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D19690

llvm-svn: 268397
2016-05-03 16:31:36 +00:00
Enrico Granata 0a99485341 Fix an issue where the apropos command would not print fully qualified command names for nested command objects
rdar://problem/26020072

llvm-svn: 268309
2016-05-02 21:28:40 +00:00
Sean Callanan c530ba98a9 Import block pointers from DWARF as Clang block pointers, not as structs.
Also added a data formatter that presents them as structs if you use frame
variable to look at their contents.  Now the blocks testcase works.

<rdar://problem/15984431>

llvm-svn: 268307
2016-05-02 21:15:31 +00:00
Enrico Granata 93529ed9b8 I forgot to check in the test case for the changes I made to synthetic children yesterday. Do so now
llvm-svn: 268263
2016-05-02 17:57:14 +00:00