summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lang/c
Commit message (Collapse)AuthorAgeFilesLines
* [lldb] Mark several tests as not dependent on debug infoRaphael Isemann2020-01-131-1/+2
| | | | | | | | | | | | | | | | Summary: This just adds `NO_DEBUG_INFO_TESTCASE` to tests that don't really exercise anything debug information specific and therefore don't need to be rerun for all debug information variants. Reviewers: labath, jingham, aprantl, mib, jfb Reviewed By: aprantl Subscribers: dexonsmith, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D72447
* Explicitly specify -std=c++11 and include <mutex> and <condition_variable>.Jim Ingham2019-12-162-0/+3
| | | | These files built on macos but not on Debian Linux. Let's see if this fixes it.
* Run all threads when extending a next range over a call.Jim Ingham2019-12-163-0/+110
| | | | | | | | | If you don't do this you end up running arbitrary code with only one thread allowed to run, which can cause deadlocks. <rdar://problem/56422478> Differential Revision: https://reviews.llvm.org/D71440
* [lldb][NFC] Remove all `setUp` overrides that only call the parent ↵Raphael Isemann2019-12-132-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | implementation Summary: A lot of our tests copied the setUp code from our TestSampleTest.py: ``` def setUp(self): # Call super's setUp(). TestBase.setUp(self) ``` This code does nothing unless we actually do any setUp work in there, so let's remove all these method definitions. Reviewers: labath, JDevlieghere Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71454
* [lldb][NFC] Remove 'from __future__ import print_function' from all tests ↵Raphael Isemann2019-12-1322-22/+0
| | | | | | | | | | | | | | | | | | | | | that don't actually call 'print()' Summary: A lot of tests do this trick but the vast majority of them don't even call `print()`. Most of this patch was generated by a script that just looks at all the files and deletes the line if there is no `print (` or `print(` anywhere else in the file. I checked the remaining tests manually and deleted the import if we never call print (but instead do stuff like `expr print(...)` and similar false-positives). I also corrected the additional empty lines after the import in the files that I manually edited. Reviewers: JDevlieghere, labath, jfb Reviewed By: labath Subscribers: dexonsmith, wuzish, nemanjai, kbarton, christof, arphaman, abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71452
* [lldb] Remove xpasses after pr44037 fix committedMuhammad Omair Javaid2019-12-131-5/+1
| | | | | | | This patch removes xpass decorator from tests which were failing due to pr44037. pr44037 was fixed by rev 6ce1a897b6a82e18059fd3b75b8d52ff12c2a605
* [lldb] Remove Xfail decorators from steadily passing testsMuhammad Omair Javaid2019-12-092-11/+0
| | | | | This patch removes xfail decorator from some lldb testcases which are passing steadily now for past few week/months on aarch64/linux buildbot.
* [lldb] s/assertTrue/assertEqual in TestStepTarget.pyPavel Labath2019-12-041-9/+7
| | | | this improves error messages.
* Mark PR44037 tests as XFAIL on AArch64 Linux dwoDiana Picus2019-11-191-1/+5
| | | | | | | | | | | | These tests are failing with various assertion failures, but they all throw the following error message first: error: a.out 0x0000002d: adding range [0x14-0x24) which has a base that is less than the function's low PC 0x40060c. See llvm.org/pr44037. Differential Revision: https://reviews.llvm.org/D70381
* [lldb] [test] Un-XFAIL tests that work on NetBSD 9Michał Górny2019-11-091-2/+0
|
* XFAIL TestLocalVariables.py on WindowsJonas Devlieghere2019-10-211-0/+1
| | | | | | | | This test has been failing for a while on the Windows bot. https://bugs.llvm.org/show_bug.cgi?id=43752 llvm-svn: 375459
* Add pretty printing of Clang "bitfield" enumsFrederic Riss2019-10-082-3/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Using enumerators as flags is standard practice. This patch adds support to LLDB to display such enum values symbolically, eg: (E) e1 = A | B If enumerators don't cover the whole value, the remaining bits are displayed as hexadecimal: (E) e4 = A | 0x10 Detecting whether an enum is used as a bitfield or not is complicated. This patch implements a heuristic that assumes that such enumerators will either have only 1 bit set or will be a combination of previous values. This patch doesn't change the way we currently display enums which the above heuristic would not consider as bitfields. Reviewers: jingham, labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D67520 llvm-svn: 374067
* Canonicalize variable usage in testsuite MakefilesAdrian Prantl2019-09-255-5/+5
| | | | | | | | | | | | This test streamlines our use of variables that are expected by Makefile.rules throughout the test suite. Mostly it replaced potentially dangerous overrides and updates of variables like CFLAGS with safe assignments to variables reserved for this purpose like CFLAGS_EXTRAS. Differential Revision: https://reviews.llvm.org/D67984 llvm-svn: 372795
* [dotest] Delete trivial inline test makefilesPavel Labath2019-09-052-4/+0
| | | | | | inline tests are able to generate these automatically llvm-svn: 371015
* [dotest] Avoid the need for LEVEL= makefile boilerplatePavel Labath2019-09-0430-87/+30
| | | | | | | | | | | | | | | | | | | | | | | Summary: Instead of each test case knowing its depth relative to the test root, we can just have dotest add the folder containing Makefile.rules to the include path. This was motivated by r370616, though I have been wanting to do this ever since we moved to building tests out-of-tree. The only manually modified files in this patch are lldbinline.py and plugins/builder_base.py. The rest of the patch has been produced by this shell command: find . \( -name Makefile -o -name '*.mk' \) -exec sed --in-place -e '/LEVEL *:\?=/d' -e '1,2{/^$/d}' -e 's,\$(LEVEL)/,,' {} + Reviewers: teemperor, aprantl, espindola, jfb Subscribers: emaste, javed.absar, arichardson, christof, arphaman, lldb-commits Differential Revision: https://reviews.llvm.org/D67083 llvm-svn: 370845
* Change test to use uint64_t to support compiling for 32-bit architectures.Adrian Prantl2019-08-151-2/+2
| | | | llvm-svn: 369034
* Adjust a ValueObjectChild's offset when the child is a bitfieldAdrian Prantl2019-08-072-0/+11
| | | | | | | | | | | | | | | | | | If a bitfield doesn't fit into the child_byte_size'd window at child_byte_offset, move the window forward until it fits. The problem here is that Value has no notion of bitfields and thus the Value's DataExtractor is sized like the bitfields CompilerType; a sequence of bitfields, however, can be larger than their underlying type. This was not in the big-endian-derived DWARF 2 bitfield attributes because their offsets were counted from the end of the window, so they always fit. rdar://problem/53132189 Differential Revision: https://reviews.llvm.org/D65492 llvm-svn: 368226
* [lldb][NFC] Remove unused imports in python testsRaphael Isemann2019-08-0219-41/+0
| | | | llvm-svn: 367663
* [lldb][test_suite] Update tests with unexpected pass on Android aarch64Alex Langford2019-07-232-1/+5
| | | | | | | | | | Summary: update some test decorates that can actually pass on andriod aarch64 Patch by Wanyi Ye <kusmour@gmail.com> Differential Revision: https://reviews.llvm.org/D64767 llvm-svn: 366858
* Add an expectedFailure test for type finding.Jim Ingham2019-07-183-0/+83
| | | | | | | | | | | | When two .c files define a type of the same name, lldb just picks one and uses it regardless of context. That is not correct. When stopped in a frame in one of the .c files that define this type, it should use that local definition. This commit just adds a test that checks for the correct behavior. It is currently xfailed. llvm-svn: 366507
* Add offsetof support to expression evaluator.Raphael Isemann2019-07-183-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We currently don't support offsetof in the expression evaluator as it is implemented as a macro (which then calls __builtin_offsetof) in stddef.h. The best solution would be to include that header (or even better, import Clang's builtin module), but header-parsing and (cross-platform) importing modules is not ready yet. Until we get this working with modules I would say we add the macro to our existing macro list as we already do with other macros from stddef.h/stdint.h. We should be able to drop all of them once we can import the relevant modules by default. rdar://26040641 Reviewers: shafik, davide Reviewed By: davide Subscribers: clayborg, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D64917 llvm-svn: 366476
* [ASTImporter] Fix LLDB lookup in transparent ctx and with ext srcGabor Marton2019-07-172-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: With LLDB we use localUncachedLookup(), however, that fails to find Decls when a transparent context is involved and the given DC has external lexical storage. The solution is to use noload_lookup, which works well with transparent contexts. But, we cannot use only the noload_lookup since the slow case of localUncachedLookup is still needed in some other cases. These other cases are handled in ASTImporterLookupTable, but we cannot use that with LLDB since that traverses through the AST which initiates the load of external decls again via DC::decls(). We must avoid loading external decls during the import becuase ExternalASTSource is implemented with ASTImporter, so external loads during import results in uncontrolled and faulty import. Reviewers: shafik, teemperor, jingham, clayborg, a_sidorin, a.sidorin Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits, lldb-commits Tags: #clang, #lldb Differential Revision: https://reviews.llvm.org/D61333 llvm-svn: 366325
* Supply a default implementation of IsRuntimeSupportValue.Adrian Prantl2019-05-031-1/+0
| | | | | | Thanks to Pavel for pointing this out. llvm-svn: 359925
* Split TestVLA into two and XFAIL one partPavel Labath2019-05-031-3/+10
| | | | | | | The part which checks whether vla_expr shows up in the variable list does not pass on non-darwin platforms. Add the appropriate decorator. llvm-svn: 359867
* Fix tests on non-Darwin platforms.Adrian Prantl2019-05-021-1/+2
| | | | llvm-svn: 359846
* Hide runtime support values such as clang's __vla_expr from frame variableAdrian Prantl2019-05-021-2/+13
| | | | | | | | | | | | by respecting the "artificial" attribute on variables. Function arguments that are artificial and useful to end-users are being whitelisted by the language runtime. <rdar://problem/45322477> Differential Revision: https://reviews.llvm.org/D61451 llvm-svn: 359841
* Fix undefined behavior in DWARFASTParser::ParseChildArrayInfo()Adrian Prantl2019-04-101-0/+2
| | | | | | | PR40827: https://bugs.llvm.org/show_bug.cgi?id=40827 <rdar://problem/48729057> llvm-svn: 358137
* [lldb] [test] Adjust XFAIL list to match buildbot resultsMichal Gorny2019-03-091-0/+2
| | | | | | | | Adjust the XFAIL-ing tests to match consistent results from buildbot. I'm going to work on differences between them and my local results following this. llvm-svn: 355774
* [lldb] [test] Mark failing tests XFAIL on NetBSDMichal Gorny2019-03-048-0/+9
| | | | | | | | | | | | | | | | Add a convenience 'expectedFailureNetBSD' decorator and mark all tests currently failing on NetBSD with it. Also skip a few tests that hang the test suite. This should establish a baseline for the test suite and get us closer to enabling tests on buildbot. This will help us catch regressions while we still have a lot of work to do to get tests working. It seems that there are also some flaky tests. I am going to address them later on. Differential Revision: https://reviews.llvm.org/D58527 llvm-svn: 355320
* Update stale comment in lang/c/struct_types/main.cJonas Devlieghere2019-02-041-2/+2
| | | | | | rdar://47322760 llvm-svn: 353087
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1913-52/+39
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Change TypeSystem::GetBitSize() to return an optional result.Adrian Prantl2019-01-161-0/+4
| | | | | | | | | | | | This patch changes the behavior when printing C++ function references: where we previously would get a <could not determine size>, there is now a <no summary available>. It's not clear to me whether this is a bug or an omission, but it's one step further than LLDB previously got. Differential Revision: https://reviews.llvm.org/D56798 llvm-svn: 351376
* [lldbsuite] Skip TestConflictingSymbol (test_shadowed) on WindowsStella Stamenova2018-12-201-0/+1
| | | | | | The test is "passing" on windows, but it is a false positive. Skip it on Windows until it is fixed on all platforms. llvm-svn: 349775
* [lldbsuite] Un-xfail TestRedefinitionsInInlines on WindowsStella Stamenova2018-12-201-6/+4
| | | | llvm-svn: 349722
* [lldbsuite] Un-xfail tests on Windows that are now passing (pt.5)Stella Stamenova2018-12-201-4/+1
| | | | | | This is a set of tests that were all marked as failing becuse of pr24764. The bug is not fixed (as in more of the tests that were marked this way are failing), but this set is passing. It is possible that some of them are false positives, but there's a large number of unexpectedly passing tests on Windows, so I am doing a bulk un-xfail to get the buildbot to green. llvm-svn: 349719
* [lldbsuite] Un-xfail tests on Windows that are now passing (pt.4)Stella Stamenova2018-12-202-3/+0
| | | | | | This is a set of tests that were all marked as failing becuse of several different bugs. A couple of the bugs are now resolved as fixed since all the tests that were failing associated with the bug are now passing. It is possible that some of them are false positives, but there's a large number of unexpectedly passing tests on Windows, so I am doing a bulk un-xfail to get the buildbot to green. llvm-svn: 349713
* [lldbsuite] Un-xfail tests on Windows that are now passing (pt.2)Stella Stamenova2018-12-191-1/+0
| | | | | | This is a set of tests that were all marked as failing becuse of pr21765. The bug is not fixed (as in more of the tests that were marked this way are failing), but this set is passing. It is possible that some of them are false positives, but there's a large number of unexpectedly passing tests on Windows, so I am doing a bulk un-xfail to get the buildbot to green. llvm-svn: 349668
* [TestVLA] Fix a python decorator.Davide Italiano2018-11-061-1/+2
| | | | llvm-svn: 346186
* Skip this test on older versions of clang.Adrian Prantl2018-11-051-0/+1
| | | | llvm-svn: 346172
* Fix (and improve) the support for C99 variable length array typesAdrian Prantl2018-11-053-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang recently improved its DWARF support for C VLA types. The DWARF now looks like this: 0x00000051: DW_TAG_variable [4] DW_AT_location( fbreg -32 ) DW_AT_name( "__vla_expr" ) DW_AT_type( {0x000000d3} ( long unsigned int ) ) DW_AT_artificial( true ) ... 0x000000da: DW_TAG_array_type [10] * DW_AT_type( {0x000000cc} ( int ) ) 0x000000df: DW_TAG_subrange_type [11] DW_AT_type( {0x000000e9} ( __ARRAY_SIZE_TYPE__ ) ) DW_AT_count( {0x00000051} ) Without this patch LLDB will naively interpret the DIE offset 0x51 as the static size of the array, which is clearly wrong. This patch extends ValueObject::GetNumChildren to query the dynamic properties of incomplete array types. See the testcase for an example: 4 int foo(int a) { 5 int vla[a]; 6 for (int i = 0; i < a; ++i) 7 vla[i] = i; 8 -> 9 pause(); // break here 10 return vla[a-1]; 11 } (lldb) fr v vla (int []) vla = ([0] = 0, [1] = 1, [2] = 2, [3] = 3) (lldb) quit rdar://problem/21814005 Differential Revision: https://reviews.llvm.org/D53530 llvm-svn: 346165
* [DWARFExpression] Read literars as unsigned values.Jonas Devlieghere2018-09-133-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | After landing r341457, we started seeing a failure on the swift-lldb bots. The change was correct and pretty straightforward, a DW_OP_constu was replaced with DW_OP_lit23, the value remaining identical. 0x000000f4: DW_TAG_variable DW_AT_location (0x00000000 [0x0000000100000a51, 0x0000000100000d47): DW_OP_lit23, DW_OP_stack_value) DW_AT_name ("number") However, this broke LLDB. (Int) number = <extracting data from value failed> The value was read correctly, but apparently the value's type was different. When reading a constu it was reading a uint64 (m_type = e_ulonglong) while for the literal, it got a signed int (m_type = e_sint). This change makes sure we read the value as an unsigned. Differential revision: https://reviews.llvm.org/D51730 llvm-svn: 342142
* Allow IRInterpreter to deal with non-power-of-2 sized types to support some ↵Frederic Riss2018-08-282-0/+47
| | | | | | | | | | | | | | | | | | | | bitfield accesses. Summary: For some bitfield patterns (like the one added by this commit), Clang will generate non-regular data types like i24 or i48. This patch follows a pretty naive approach of just bumping the type size to the next power of 2. DataExtractor know how to deal with weird sizes. The operations on Scalar do not know how to deal with those types though, so we have to legalize the size when creating a Scalar. Reviewers: jingham, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D51245 llvm-svn: 340880
* Change xfail to skipIf. The exact condition is really difficult to getAdrian Prantl2018-08-231-1/+1
| | | | | | right and doesn't add much signal. llvm-svn: 340574
* XFAIL test for older versions of clangAdrian Prantl2018-08-231-1/+1
| | | | llvm-svn: 340573
* XFAIL test for older versions of dsymutilAdrian Prantl2018-08-231-0/+1
| | | | llvm-svn: 340550
* Fix whitespace in the python test suite.Raphael Isemann2018-07-271-1/+1
| | | | | | | | | | | | | Summary: The test suite has often unnecessary trailing whitespace, and sometimes unnecessary trailing lines or a missing final new line. This patch just strips trailing whitespace/lines and adds missing newlines at the end. Subscribers: ki.stfu, JDevlieghere, christof, lldb-commits Differential Revision: https://reviews.llvm.org/D49943 llvm-svn: 338171
* DebugNamesDWARFIndex: Implement DWARFDeclContext variant of GetTypes methodPavel Labath2018-06-121-2/+15
| | | | | | | | | | | | This method is used to find complete definitions of a type when one parses a compile unit with only forward declaration available. Since it is only accessed from DWARFASTParserClang, it was not possible/easy to trigger this codepath from lldb-test. Therefore, I adapt add a debug-names variant to an existing dotest test to cover this scenario. llvm-svn: 334516
* [lit, windows] Disable a number of tests that are failing on WindowsStella Stamenova2018-06-072-0/+6
| | | | | | | | | | | | | | Summary: They all correspond to bugs that are already logged and I've added the appropriate (or most appropriate) bug numbers. This leaves only a handful of failing tests. Reviewers: asmith, zturner, labath Reviewed By: zturner Subscribers: eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D47892 llvm-svn: 334210
* [test] Re-enable TestUnicodeSymbolsJonas Devlieghere2018-05-081-1/+0
| | | | | | | | Re-enable TestUnicodeSymbols now that we use the in-tree dsymutil. This was disabled because the hashing of unicode symbols was out of sync between llvm (dsymutil) and lldb. llvm-svn: 331764
* Remove redundant command.Adrian Prantl2018-05-011-1/+0
| | | | llvm-svn: 331270
OpenPOWER on IntegriCloud