summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lang/cpp
Commit message (Collapse)AuthorAgeFilesLines
* Made templates that have Enumeration values as arguments work correctly.Greg Clayton2016-06-242-1/+69
| | | | | | | | | | We were checking for integer types only before this. So I added the ability for CompilerType objects to check for integer and enum types. Then I searched for places that were using the CompilerType::IsIntegerType(...) function. Many of these places also wanted to be checking for enumeration types as well, so I have fixed those places. These are in the ABI plug-ins where we are figuring out which arguments would go in where in regisers/stack when making a function call, or determining where the return value would live. The real fix for this is to use clang to compiler a CGFunctionInfo and then modify the code to be able to take the IR and a calling convention and have the backend answer the questions correctly for us so we don't need to create a really bad copy of the ABI in each plug-in, but that is beyond the scope of this bug fix. Also added a test case to ensure this doesn't regress in the future. llvm-svn: 273750
* Test that lldb calls the right 'printf' even when a 'printf' method exists.Sean Callanan2016-06-202-0/+25
| | | | | | This test is currently failing. We have a bug for it, as noted. llvm-svn: 273211
* xfail TestWithModuleDebugging.py on macOSTodd Fiala2016-06-161-0/+1
| | | | | | | Tracked by: https://llvm.org/bugs/show_bug.cgi?id=28156 llvm-svn: 272902
* Fixed C++ template integer parameter types to work correctly when the ↵Greg Clayton2016-06-103-0/+94
| | | | | | | | | | | | integer type is signed. Prior to this we would display the typename for "TestObj<-1>" as "TestObj<4294967295>" when we showed the type. Expression parsing could also fail because we would fail to find the mangled name when evaluating expressions. The issue was we were losing the signed'ness of the template integer parameter in DWARFASTParserClang.cpp. <rdar://problem/25577041> llvm-svn: 272434
* Enable some tests on linuxPavel Labath2016-06-092-2/+0
| | | | | | | | | This enables a couple of tests which have been shown to run reliably on the linux x86 buildbot. If you see a failure after this commit, feel free to add the xfail back, but please make it as specific as possible (i.e., try to make it not cover i386/x86_64 with clang-3.5, clang-3.9 or gcc-4.9). llvm-svn: 272326
* Revert "Make lldbinline.py regenerate the Makefile each time it builds."Pavel Labath2016-06-072-15/+0
| | | | | | This reverts commit r272024 as it is not windows-compatible. llvm-svn: 272062
* Make lldbinline.py regenerate the Makefile each time it builds.Sean Callanan2016-06-072-0/+15
| | | | | | | | | | | | | If a lldbinline test's source file changed language, then the Makefile wasn't updated. This was a problem if the Makefile was checked into the repository. Now lldbinline.py always regenerates the Makefile and asserts if the newly-generated version is not the same as the one already there. This ensures that the repository will never be out of date without a buildbot failing. http://reviews.llvm.org/D21032 llvm-svn: 272024
* Fix makefile for TestExternCSymbolsTamas Berghammer2016-06-031-1/+1
| | | | llvm-svn: 271618
* Fixed a problem where we couldn't call extern "C" functions.Sean Callanan2016-06-023-0/+36
| | | | | | | | | | | | | Some compilers do not mark up C++ functions as extern "C" in the DWARF, so LLDB has to fall back (if it is about to give up finding a symbol) to using the base name of the function. This fix also ensures that we search by full name rather than "auto," which could cause unrelated C++ names to be found. Finally, it adds a test case. <rdar://problem/25094302> llvm-svn: 271551
* Add "-gmodules" support to the test suite.Todd Fiala2016-05-261-7/+1
| | | | | | | | | | | | | | 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
* Avoid using stdio in TestVirtualPavel Labath2016-05-262-20/+22
| | | | | | | | | | | | | | 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
* Clean up test results on Windows.Zachary Turner2016-05-132-1/+3
| | | | | | | | | 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
* Enable ↵Pavel Labath2016-05-091-1/+1
| | | | | | | | NamespaceLookupTestCase.test_scope_lookup_before_using_with_run_command on linux test appears to be passing now. llvm-svn: 268923
* XFail TestLambdas.py on Windows after fixing some of the problemsAdrian McCarthy2016-05-042-4/+4
| | | | | | | | | | | | | | 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
* [fix] Fixed a bug where const this would cause parser errors about $__lldb_expr.Sean Callanan2016-04-293-0/+35
| | | | | | | | | | | | | | | | | | | In templated const functions, trying to run an expression would produce the error error: out-of-line definition of '$__lldb_expr' does not match any declaration in 'foo' member declaration does not match because it is const qualified error: 1 error parsing expression which is no good. It turned out we don't actually need to worry about "const," we just need to be consistent about the declaration of the expression and the FunctionDecl we inject into the class for "this." Also added a test case. <rdar://problem/24985958> llvm-svn: 268083
* Revert "Fixed a bug where const this would cause parser errors about ↵Pavel Labath2016-04-283-35/+0
| | | | | | | | | | $__lldb_expr." This reverts commit r267833 as it breaks the build. It looks like some work in progress got committed together with the actual fix, but I'm not sure which one is which, so I'll revert the whole patch and let author resumbit it after fixing the build error. llvm-svn: 267861
* Fixed a bug where const this would cause parser errors about $__lldb_expr.Sean Callanan2016-04-283-0/+35
| | | | | | | | | | | | | | | | | | | In templated const functions, trying to run an expression would produce the error error: out-of-line definition of '$__lldb_expr' does not match any declaration in 'foo' member declaration does not match because it is const qualified error: 1 error parsing expression which is no good. It turned out we don't actually need to worry about "const," we just need to be consistent about the declaration of the expression and the FunctionDecl we inject into the class for "this." Also added a test case. <rdar://problem/24985958> llvm-svn: 267833
* Remove flaky decorator from three tests on linuxPavel Labath2016-04-271-1/+0
| | | | | | The flakyness is no longer reproducible, and the tests seem to be passing reliably now. llvm-svn: 267704
* Adds a test to detect when clang omits specialized generic types from debug ↵Kate Stone2016-04-194-0/+80
| | | | | | information when using precompiled headers and -gmodules. llvm-svn: 266791
* Added a testcase for defining and using lambdas in the expression parser.Sean Callanan2016-04-152-0/+21
| | | | | | <rdar://problem/25739133> llvm-svn: 266397
* Fix test cases for big-endian systemsUlrich Weigand2016-04-141-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A number of test cases were failing on big-endian systems simply due to byte order assumptions in the tests themselves, and no underlying bug in LLDB. These two test cases: tools/lldb-server/lldbgdbserverutils.py python_api/process/TestProcessAPI.py actually check for big-endian target byte order, but contain Python errors in the corresponding code paths. These test cases: functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py functionalities/data-formatter/synthcapping/TestSyntheticCapping.py lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py python_api/sbdata/TestSBData.py (first change) could be fixed to check for big-endian target byte order and update the expected result strings accordingly. For the two synthetic tests, I've also updated the source to make sure the fake_a value is always nonzero on both big- and little-endian platforms. These test case: python_api/sbdata/TestSBData.py (second change) functionalities/memory/cache/TestMemoryCache.py simply accessed memory with the wrong size, which wasn't noticed on LE but fails on BE. Differential Revision: http://reviews.llvm.org/D18985 llvm-svn: 266315
* Skip a test in TestNamespaceLookup on linux to avoid a crashPavel Labath2016-04-121-0/+1
| | | | llvm-svn: 266054
* Switch from unittest2.expectedFailure to our own decorator on TestSTLPavel Labath2016-03-161-2/+1
| | | | | | | the main reason is that our decorator contains extra fluff to "expect" crashes (which seem to happen occasionaly on the android buildbot). llvm-svn: 263633
* Fix TestInlines.py on WindowsAdrian McCarthy2016-02-294-0/+114
| | | | | | | | | | | | | | The inlining semantics for C and C++ are different, which affects the test's expectation of the number of times the function should appear in the binary. In the case of this test, C semantics means there should be three instances of inner_inline, while C++ semantics means there should be only two. On Windows, clang uses C++ inline semantics even for C code, and there doesn't seem to be a combination of compiler flags to avoid this. So, for consistency, I've recast the test to use C++ everywhere. Since the test resided under lang/c, it seemed appropriate to move it to lang/cpp. This does not address the other XFAIL for this test on Linux/gcc. See https://llvm.org/bugs/show_bug.cgi?id=26710 Differential Revision: http://reviews.llvm.org/D17650 llvm-svn: 262255
* Remove expectedFailureFreeBSD decoratorEd Maste2016-02-192-2/+2
| | | | | | | | All invocations are updated to use the generic expectedFailureAll. Differential Revision: http://reviews.llvm.org/D17455 llvm-svn: 261355
* Remove XFAIL from test passing on FreeBSDEd Maste2016-02-191-1/+0
| | | | | | | | Both Linux and FreeBSD had a comment "This needs to be root-caused." It looks like the failure has been fixed on both, and the Linux XFAIL decorator was removed in r233716 (Mar 2015). llvm-svn: 261333
* Enable TestUnicodeLiteralsPavel Labath2016-02-191-4/+0
| | | | | | Test should work everywhere except windows now. llvm-svn: 261314
* Renamed TestRdar12991846 to the more descriptive TestUnicodeLiterals.Sean Callanan2016-02-123-1/+1
| | | | | | | Test cases should not be named after PR or Radar numbers. It's fine to annotate them with these numbers in comments, however. llvm-svn: 260699
* Remove FreeBSD failure decorator from TestCppIncompleteTypesEd Maste2016-02-101-1/+0
| | | | | | | | | | CFLAGS is now being set correctly to pass -flimit-debug-info or -fno-limit-debug-info on FreeBSD. I'm not sure which change is responsible for the fix, though. llvm.org/pr25626 llvm-svn: 260330
* Remove skipIf<compiler> decorators.Zachary Turner2016-02-091-2/+2
| | | | | | | These were supposed to have been removed in a previous patch, but I missed them. llvm-svn: 260291
* Delete all the xfail / skip decorators for specific compilers.Zachary Turner2016-02-098-10/+9
| | | | | | Ported everything over to using expectedFailureAll. llvm-svn: 260289
* A number of improvements to decorator conditionals.Zachary Turner2016-02-081-1/+1
| | | | | | | | | | | | | | | | | | | * Change the `not_in` function to be called `no_match`. This makes it clear that keyword arguments can be more than just lists. * Change the name of `_check_list_or_lambda` to `_match_decorator_property`. Again clarifying that decorator params are not always lists. * Always use a regex match when matching strings. This allows automatic support for regex matching on all decorator properties. Also support compiled regex values. * Fix a bug in the compiler check used by _decorateTest. The two arguments were reversed, the condition was always wrong. * Change one test that uses skipUnlessArch to use skipIf, to demonstrate that skipIf can now handle more scenarios. Differential Revision: http://reviews.llvm.org/D16938 llvm-svn: 260135
* Remove expectedFailureWindows decorator.Zachary Turner2016-02-0816-30/+22
| | | | | | | | | | | | | | | expectedFailureWindows is equivalent to using the general expectedFailureAll decorator with oslist="windows". Additionally, by moving towards these common decorators we can solve the issue of having to support decorators that can be called with or without arguments. Once all decorators are always called with arguments, and this is enforced by design (because you can't specify the condition you're decorating for without passing an argument) the implementation of the decorators can become much simpler Differential Revision: http://reviews.llvm.org/D16936 llvm-svn: 260134
* Take 2: Use an artifical namespace so that member vars do not hide local vars.Siva Chandra2016-02-053-0/+275
| | | | | | | | | | | | Summary: This relands r259810 with fix for failures on Mac. Reviewers: spyffe, tfiala Subscribers: tfiala, lldb-commits Differential Revision: http://reviews.llvm.org/D16900 llvm-svn: 259902
* Move the rest of the tests over to using the new decorator module.Zachary Turner2016-02-0423-23/+46
| | | | llvm-svn: 259838
* Revert "Use an artifical namespace so that member vars do not hide local vars."Siva Chandra2016-02-043-275/+0
| | | | | | | | | | | | | | Summary: This reverts commit 8af14b5f9af68c31ac80945e5b5d56f0a14b38e4. Reverting as it breaks a few tests on Mac. Reviewers: spyffe Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D16895 llvm-svn: 259823
* Use an artifical namespace so that member vars do not hide local vars.Siva Chandra2016-02-043-0/+275
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: While evaluating expressions when stopped in a class method, there was a problem of member variables hiding local variables. This was happening because, in the context of a method, clang already knew about member variables with their name and assumed that they were the only variables with those names in scope. Consequently, clang never checks with LLDB about the possibility of local variables with the same name and goes wrong. This change addresses the problem by using an artificial namespace "$__lldb_local_vars". All local variables in scope are declared in the "$__lldb_expr" method as follows: using $__lldb_local_vars::<local var 1>; using $__lldb_local_vars::<local var 2>; ... This hides the member variables with the same name and forces clang to enquire about the variables which it thinks are declared in $__lldb_local_vars. When LLDB notices that clang is enquiring about variables in $__lldb_local_vars, it looks up local vars and conveys their information if found. This way, member variables do not hide local variables, leading to correct evaluation of expressions. A point to keep in mind is that the above solution does not solve the problem for one specific case: namespace N { int a; } class A { public: void Method(); int a; }; void A::Method() { using N::a; ... // Since the above solution only touches locals, it does not // force clang to enquire about "a" coming from namespace N. } Reviewers: clayborg, spyffe Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D16746 llvm-svn: 259810
* Move some of the common decorators to decorators.py.Zachary Turner2016-02-043-3/+6
| | | | | | | | | | | | This doesn't attempt to move every decorator. The reason for this is that it requires touching every single test file to import decorators.py. I would like to do this in a followup patch, but in the interest of keeping the patches as bite-sized as possible, I've only attempted to move the underlying common decorators first. A few tests call these directly, so those tests are updated as part of this patch. llvm-svn: 259807
* Always write the session file in UTF-8.Zachary Turner2016-02-011-1/+0
| | | | | | | | | | | | | | | | | | This patch attempts to solve the Python 2 / Python 3 incompatibilities by introducing a new `encoded_file` abstraction that we use instead of `io.open()`. The problem with the builtin implementation of `io.open` is that `read` and `write` accept and return `unicode` objects, which are not always convenient to work with in Python 2. We solve this by making `encoded_file.open()` return the same object returned by `io.open()` but with hooked `read()` and `write()` methods. These hooked methods will accept binary or text data, and conditionally convert what it gets to a `unicode` object using the correct encoding. When calling `read()` it also does any conversion necessary to convert the output back into the native `string` type of the running python version. Differential Revision: http://reviews.llvm.org/D16736 llvm-svn: 259379
* Revert "Resubmit r258759 with proper unicode handling."Zachary Turner2016-01-271-0/+1
| | | | | | This reverts commit 2c79d60214e146b13b233392a859b4f79340e90e. llvm-svn: 258978
* Resubmit r258759 with proper unicode handling.Zachary Turner2016-01-271-1/+0
| | | | | | | | | Instead of opening the file in unicode mode, we need only encode data which potentially has non-ASCII characters as UTF8 before writing. This should work across both Python versions, and is also far simpler than anything else discussed. llvm-svn: 258969
* XFail TestCPPAuto on Windows until we can find the root problem.Adrian McCarthy2016-01-271-0/+1
| | | | | | llvm.org/pr26339 llvm-svn: 258943
* Reverting r258759 as it is breaking the OSX buildEnrico Granata2016-01-261-0/+1
| | | | llvm-svn: 258791
* Write the session log file in UTF-8.Zachary Turner2016-01-261-1/+0
| | | | | | | | | | | Previously we were writing in the default encoding, which depends on the operating system and is not guaranteed to be unicode aware. On Python 3, this would lead to a situation where writing unicode text to the log file generates an exception. The fix here is to write session logs using the proper encoding, which incidentally fixes another test, so xfail is removed from that. llvm-svn: 258759
* XFail TestNamespaceLookup tests on Windows.Adrian McCarthy2016-01-221-1/+5
| | | | | | There's already a pr: https://llvm.org/bugs/show_bug.cgi?id=25819 llvm-svn: 258577
* NFC. Corrects name of test class and a comment.Adrian McCarthy2016-01-211-2/+2
| | | | llvm-svn: 258433
* Remove assumptions that thread 0 is always the main thread.Zachary Turner2016-01-215-18/+12
| | | | | | | | | | | | | | | | | Starting with Windows 10, the Windows loader is itself multi-threaded, meaning that the loader spins up a few threads to do process initialization before it executes main. Windows delivers these notifications asynchronously and they can come out of order, so we can't be sure that the first thread we get a notification about is actually the zero'th thread. This patch fixes this by requesting the thread stopped at the breakpoint that was specified, rather than getting thread 0 and verifying that it is stopped at a breakpoint. Differential Revision: http://reviews.llvm.org/D16247 llvm-svn: 258432
* XFAIL TestCppNsImport on FreeBSDEd Maste2015-12-221-0/+1
| | | | | | | | | It has an existing XFAIL annotation for GCC >= 4.9 but it also fails on FreeBSD 10.x with Clang 3.4.1. llvm.org/pr25925 llvm-svn: 256270
* Add expectedFailureFreeBSD to tests failing in the same way as on LinuxEd Maste2015-12-221-0/+3
| | | | | | llvm.org/pr25819 llvm-svn: 256250
* [TestCPPAuto] On linux, we need -fno-limit-debug-info.Siva Chandra2015-12-192-1/+4
| | | | | | | | | | | | Summary: Also xfailed for GCC as there is an problem with debug info generation. Reviewers: granata.enrico Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D15657 llvm-svn: 256067
OpenPOWER on IntegriCloud