summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lang/cpp
Commit message (Collapse)AuthorAgeFilesLines
* Really test type lookup in TestCppTypeLookup.pyFrederic Riss2018-05-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: ... and fix one bug found this way. Currently, the test works not because types are looked up correctly, but because by injecting local variables we also materialize the types for Clang. If we disable the local variable injection, then one check fails. The reason of the failure is that FindTypes is run with max_matches==1 and this value is passed down to the symbol lookup functions. When the search is performed only on the basename (like it's the case for an entity defined in the root namespace), then the search will stop after having found one match on the basename. But that match might be in a namespace, we were really just looking up the basename in the accelerator tables. The solution is to not pass max_matches down, but to search without a limit and let RemoveMismatchedTypes do its job afterwards. Note the patch includes 2 hunks with the same change, but only the latter is tested. I couldn't find a way to create a testcase for the other branch of the if ('image lookup -t' allows me to get there, but it only ever returns one type anyway). Reviewers: clayborg, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D46548 llvm-svn: 331719
* Fix type_lookup test to make buildbots happyEugene Zemtsov2018-05-013-3/+3
| | | | llvm-svn: 331242
* Fix expression parser to not accept any type whose basename matches for a ↵Greg Clayton2018-04-303-0/+159
| | | | | | | | | | type that must exist at root level This patch fixes an issue where we weren't looking for exact matches in the expression parser and also fixed the type lookup logic in the Module.cpp. Tests added to make sure we don't regress. Differential Revision: https://reviews.llvm.org/D46128 llvm-svn: 331227
* Fix a crash when resolving overloads of C++ virtual methods.Adrian Prantl2018-04-203-0/+25
| | | | | | | | | The isOverload() method needs to account for situations where the two methods being compared don't have the same number of arguments. rdar://problem/39542960 llvm-svn: 330450
* Support template template parametersFrederic Riss2018-04-022-0/+35
| | | | | | | | | | | | | | | | | | Summary: We would fail to resolve (and thus display the value of) any templated type which contained a template template argument even though we don't really use template arguments. This patch adds minimal support for template template arguments, but I doubt we need any more than that. Reviewers: clayborg, jingham Subscribers: JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D44613 llvm-svn: 328984
* Revert r328715. Wasn't wrong, just not the issue.Jim Ingham2018-03-281-1/+0
| | | | llvm-svn: 328721
* Explicitly import subprocessJim Ingham2018-03-281-0/+1
| | | | | | | For some reason on one of our bots subprocess wasn't already imported. Do so explicitly. llvm-svn: 328715
* Add support for __attribute__(trivial_abi).Jim Ingham2018-03-233-0/+115
| | | | | | <rdar://problem/36035075>, <rdar://problem/36035039> llvm-svn: 328389
* Fix TestOperatorOverload for 32-bit buildsPavel Labath2018-03-212-14/+4
| | | | | | | | | | | | - use more goodies from Makefile.rules to correctly build a 32-bit binary. - avoid hardcoding typeof(nil) in the test. This should partially fix the linux bot. There is still one assertion failure remaining, which I'll have to investigate separately, as I am not experiencing it locally. llvm-svn: 328083
* [Testsuite] Modernize this test to be run out-of-tree.Davide Italiano2018-03-201-5/+3
| | | | | | | | New tests should run the make syntax voodoo $@ and $< instead of hardcoding the names. We should also document how to write one, it's on my list. llvm-svn: 328062
* [ExpressionParser] Re-implement r327356 in a less disruptive way.Davide Italiano2018-03-204-0/+61
| | | | | | | | | | | | Instead of applying the sledgehammer of refusing to insert any C++ symbol in the ASTContext, try to validate the decl if what we have is an operator. There was other code in lldb which was responsible for this, just not really exposed (or used) in this codepath. Also, add a better/more comprehensive test. <rdar://problem/35645893> llvm-svn: 328025
* Modernize a test.Jim Ingham2018-03-191-29/+2
| | | | llvm-svn: 327924
* [DWARFASTParserClang] Complete external record types before using them as a ↵Frederic Riss2018-03-163-0/+31
| | | | | | | | | | | | | | | | | | decl context. Summary: When in a gmodules-like debugging scenario, you can have a parent decl context that gets imported from an external AST. When this happens, we must be careful to complete this type before adding children to it, otherwise it sometimes results in a crash. Reviewers: clayborg, jingham Subscribers: aprantl, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D43592 llvm-svn: 327750
* [test] Replace some references to Apple-internal bugsVedant Kumar2018-03-134-13/+3
| | | | | | | This removes around 10 references to Apple-internal radars. I've filed fresh bugs on bugs.llvm.org as appropriate for open issues. llvm-svn: 327463
* Make TestDynamicValueSameBase gcc-compatiblePavel Labath2018-03-011-3/+7
| | | | | | | | | | gcc will say that the type of "this" is "T * const", clang "T *". Compare the unqualified type names to erase the difference between the two, as the constness is not a part of this test. FWIW, I think that the gcc behavior makes more sense here. llvm-svn: 326449
* We were getting the wrong dynamic type if there were two classes with the ↵Jim Ingham2018-03-013-0/+99
| | | | | | | | | | | | | | same basename. There's a bug in FindTypes, it ignores the exact flag if you pass a name that doesn't begin with :: and pass eTypeClassAny for the type. In this case we always know that the name we get from the vtable name is absolute so we can work around the bug by prepending the "::". This doesn't fix the FindTypes bug. <rdar://problem/38010986> llvm-svn: 326412
* Mark test_*int*_t_dwarf as failing on FreeBSDEd Maste2018-02-271-0/+9
| | | | | | | | | | | | Further investigation required; tests will be enabled on the buildbot worker soon. Marking failing tests for now in order to start with a green buildbot while investigation takes place. This is a recommit of r326134, with the required import added. llvm.org/pr36527 llvm-svn: 326166
* Revert r326134 due to broken buildbotEd Maste2018-02-261-8/+0
| | | | llvm-svn: 326139
* Mark test_*int*_t_dwarf as failing on FreeBSDEd Maste2018-02-261-0/+8
| | | | | | | | | | Further investigation required; tests will be enabled on the buildbot worker soon. Marking failing tests for now in order to start with a green buildbot while investigation takes place. llvm.org/pr36527 llvm-svn: 326134
* Only throw -fPIC when building a shared libraryAaron Smith2018-02-082-4/+0
| | | | | | | | | | | | | | | | | | Summary: Update makefiles to specify -fPIC in Makefile.rules and only throw -fPIC when building a shared library. This change is necessary to allow building the lldb tests on Windows where -fPIC is not a valid option. Update a few places to Python 3.x syntax Reviewers: zturner, lldb-commits Reviewed By: zturner Subscribers: stella.stamenova, labath, llvm-commits Differential Revision: https://reviews.llvm.org/D42994 llvm-svn: 324671
* Compile the LLDB tests out-of-tree.Adrian Prantl2018-01-3010-23/+14
| | | | | | | | | | | | | | | | | | | | | | | | This patch is the result of a discussion on lldb-dev, see http://lists.llvm.org/pipermail/lldb-dev/2018-January/013111.html for background. For each test (should be eventually: each test configuration) a separate build directory is created and we execute make VPATH=$srcdir/path/to/test -C $builddir/path/to/test -f $srcdir/path/to/test/Makefile -I $srcdir/path/to/test In order to make this work all LLDB tests need to be updated to find the executable in the test build directory, since CWD still points at the test's source directory, which is a requirement for unittest2. Although we have done extensive testing, I'm expecting that this first attempt will break a few bots. Please DO NOT HESITATE TO REVERT this patch in order to get the bots green again. We will likely have to iterate on this some more. Differential Revision: https://reviews.llvm.org/D42281 llvm-svn: 323803
* Skip TestWithModuleDebugging on i386 linux (pr36146)Pavel Labath2018-01-301-0/+1
| | | | | | It fails due to an assertion (if these are enabled). llvm-svn: 323736
* Fix linux fallout from c++ gmodules enablePavel Labath2018-01-261-2/+4
| | | | | | | | | | | TestLibcxxListLoop - fails because the evil "define private public" trick does not work with gmodules. The purpose of the test is not to test debug info parsing so I just mark it as no_debug_info_testcase. In the long term it may be interesting to write a mock std::list which will allow us to test bad inputs to data formatters more easily. TestGModules - seems to be a genuine bug. Filed pr36107 and xfailed. llvm-svn: 323520
* Wrap all references to build artifacts in the LLDB testsuite (NFC)Adrian Prantl2018-01-1938-58/+57
| | | | | | | | | in TestBase::getBuildArtifact(). This NFC commit is in preparation for https://reviews.llvm.org/D42281 (compile the LLDB tests out-of-tree). Differential Revision: https://reviews.llvm.org/D42280 llvm-svn: 323007
* Skip TestFunctionTemplateParameterPack.py, which unexpectedly asserts (PR35920)Vedant Kumar2018-01-121-1/+7
| | | | | | | | | | This test stresses expression evaluation support for template functions. Currently the support is rudimentary, and running this test causes assertion failures in clang. This test cannot be XFAIL'ed because the test harness treats assertion failures as unexpected events. For now, the test must be skipped. llvm-svn: 322340
* Look for external types in all clang modules imported by the current symbol ↵Adrian Prantl2018-01-047-0/+51
| | | | | | | | | | | | | file. This fixes a bug in -gmodules DWARF handling when debugging without a .dSYM bundle that was particularly noticable when debugging LLVM itself. Debugging without clang modules and DWO handling should be unaffected by this patch. <rdar://problem/32436209> llvm-svn: 321802
* Work around test failures on red-hat linuxPavel Labath2017-12-211-1/+1
| | | | | | | | | | | | | | | | Two tests were failing because the debugger was picking up multiply defined internal symbols from the system libraries. This is a bug, as there should be no ambiguity because the tests are defining variables with should shadow these symbols, but lldb is not smart enough to figure that out. I work around the issue by renaming the variables in these tests, and in exchange I create a self-contained test which reproduces the issue without depending on the system libraries. This increases the predictability of our test suite. llvm-svn: 321271
* [TestCppScope] This test now passes on Darwin.Davide Italiano2017-12-121-5/+0
| | | | | | | | | I tested on x86-64 and Jason on embedded architectures. This cleans up another couple of reported unexpected successes. <rdar://problem/28623427> llvm-svn: 320452
* Makefile.rules: compile all tests with -fno-limit-debug-infoPavel Labath2017-12-043-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This flag is on by default for darwin and freebsd, but off for linux. Without it, clang will sometimes not emit debug info for types like std::string. Whether it does this, and which tests will fail because of that depends on the linux distro and c++ library version. A bunch of tests were already setting these flags manually, but here instead I take a whole sale approach and enable this flag for all tests. Any test which does not want to have this flag (right now we have one such test) can turn it off explicitly via CFLAGS_EXTRAS+=$(LIMIT_DEBUG_INFO_FLAGS) This fixes a bunch of data formatter tests on red-hat. Reviewers: davide, jankratochvil Subscribers: emaste, aprantl, krytarowski, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D40717 llvm-svn: 319653
* Support scoped enums in the DWARF AST parserTamas Berghammer2017-11-071-2/+2
| | | | | | | | Subscribers: JDevlieghere Differential Revision: https://reviews.llvm.org/D39545 llvm-svn: 317563
* remove FreeBSD xfail decorator from TestCppNsImportEd Maste2017-08-101-1/+0
| | | | | | | | | | The Linux xfail decorator was removed in r272326 with the claim that the test "runs reliably on the linux x86 buildbot." It also runs reliably on FreeBSD for me. llvm.org/pr25925 llvm-svn: 310644
* RFix PR33875 by distinguishing between DWO and clang modules.Adrian Prantl2017-07-241-2/+0
| | | | | | | | This reapplies https://reviews.llvm.org/D35740 with a tweak to find the section by name rather than type. Section types don't distinguish between regular sections and their DWO counterparts. llvm-svn: 308905
* Revert "Fix PR33875 by distinguishing between DWO and clang modules"Adrian Prantl2017-07-231-0/+2
| | | | | | This reverts commit r308850. llvm-svn: 308851
* Fix PR33875 by distinguishing between DWO and clang modulesAdrian Prantl2017-07-231-2/+0
| | | | | | | | | | | | | | The DWO handling code can get confused by clang modules which also use skeleton CUs to point to the object file with the full debug info. This patch detects whether an object is a "real" DWO or a clang module and prevents LLDB from interpreting clang modules as DWO. This fixes the regression in TestWithModuleDebugging. http://llvm.org/bugs/show_bug.cgi?id=33875 Differential Revision: https://reviews.llvm.org/D35740 llvm-svn: 308850
* XFail TestWithModuleDebugging on linux (bug 33875)Pavel Labath2017-07-211-0/+2
| | | | llvm-svn: 308732
* Added a testcase for local/namespaced name conflicts.Sean Callanan2017-05-313-0/+39
| | | | | | | | | This works on SVN but is a bit fragile on the Swift branch. I'm adding the test to both, so we have this path covered. <rdar://problem/32372372> llvm-svn: 304314
* xfail TestClassTemplateParameterPack on gcc to mollify ↵Sean Callanan2017-05-111-1/+3
| | | | | | lldb-x86_64-ubuntu-14.04-cmake. llvm-svn: 302850
* [DWARF parser] Produce correct template parameter packsSean Callanan2017-05-116-0/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Templates can end in parameter packs, like this template <class T...> struct MyStruct { /*...*/ }; LLDB does not currently support these parameter packs; it does not emit them into the template argument list at all. This causes problems when you specialize, e.g.: template <> struct MyStruct<int> { /*...*/ }; template <> struct MyStruct<int, int> : MyStruct<int> { /*...*/ }; LLDB generates two template specializations, each with no template arguments, and then when they are imported by the ASTImporter into a parser's AST context we get a single specialization that inherits from itself, causing Clang's record layout mechanism to smash its stack. This patch fixes the problem for classes and adds tests. The tests for functions fail because Clang's ASTImporter can't import them at the moment, so I've xfailed that test. Differential Revision: https://reviews.llvm.org/D33025 llvm-svn: 302833
* Name the C++ source files for two tests correctly.Sean Callanan2017-04-242-2/+2
| | | | llvm-svn: 301280
* Fixed two bad Makefiles that might be breaking Linux.Sean Callanan2017-04-242-2/+2
| | | | llvm-svn: 301277
* [Expression parser] Return both types and variablesSean Callanan2017-04-247-2/+98
| | | | | | | | | | | | | | | | | | | | | Many times a user wants to access a type when there's a variable of the same name, or a variable when there's a type of the same name. Depending on the precise context, currently the expression parser can fail to resolve one or the other. This is because ClangExpressionDeclMap has logic to limit the amount of information it searches, and that logic sometimes cuts down the search prematurely. This patch removes some of those early exits. In that sense, this patch trades performance (early exit is faster) for correctness. I've also included two new test cases showing examples of this behavior – as well as modifying an existing test case that gets it wrong. llvm-svn: 301273
* Update two android XFAILSPavel Labath2017-04-241-1/+1
| | | | | | | - XFAIL on TestNoreturnUnwind on all architectures - TestStaticVariables fails with clang-3.8 as well llvm-svn: 301186
* Make TestStaticVariables XFAIL more specificPavel Labath2017-04-201-6/+5
| | | | | | | | The test fails because an older clang did not emit the required debug info (I am not sure when this got added, but clang-3.7 certainly did not work yet). The actual platform has nothing to do with this. llvm-svn: 300834
* TestStaticVariables still fails on Linux.Jim Ingham2017-04-181-0/+2
| | | | llvm-svn: 300519
* This test is succeeding on macOS with clang.Jim Ingham2017-04-181-6/+1
| | | | llvm-svn: 300517
* Fix TestCppIncompleteTypes for android/clangPavel Labath2017-04-121-2/+2
| | | | | | | LDFLAGS contains some .a files. If it is specified before the relevant object files, undefined symbol errors occur. llvm-svn: 300048
* Mark xfail TestNamespaceDefinitions for arm/aarch64 targetsOmair Javaid2016-11-111-0/+3
| | | | | | | | Fails with all versions of arm/aarch64 gcc available on ubuntu 16.04/14.04. Passes with Linaro GCC version >= 4.8 but fails with >= 5.0. But There are other regressions when we use Linaro GCC. llvm-svn: 286574
* Fix expectation in TestStaticVariables.py after rL286302Tamas Berghammer2016-11-091-1/+1
| | | | | | | | The debug info emitted by clang for static variables improved by rL286302 and it exposed an incorrect test expactation because now LLDB able to displays more data 9thanks to better debug info) then before. llvm-svn: 286360
* Fix an issue where frame variable -s <varname> would not show the scope even ↵Enrico Granata2016-10-261-1/+1
| | | | | | | | though the user asked for it Part of rdar://28434047 llvm-svn: 285226
* Fixing the bug number for darwin on this failure.Jim Ingham2016-10-111-1/+3
| | | | llvm-svn: 283843
OpenPOWER on IntegriCloud