summaryrefslogtreecommitdiffstats
path: root/lldb/test/lang/c
Commit message (Collapse)AuthorAgeFilesLines
...
* Added a C language test case that verifies thatSean Callanan2015-04-033-0/+106
| | | | | | | | | | DWARF types and types from modules can coexist even if they have the same name and refer to two different things. <rdar://problem/18805055> llvm-svn: 233988
* Many many test failures after some recent changes. The problem is ↵Greg Clayton2015-04-022-2/+2
| | | | | | | | | | | | | | | | lldbtest.getPlatform() returns the "OS" of the selected platform's triple. This is "macosx" for desktop macosx and "ios" for iOS. It used to be "darwin". There was a lot of code that was checking "if self.getPlatform() == 'darwin'" which is not correct. I fixed this by adding a: lldbtest.platformIsDarwin() which returns true if the current platform's OS is "macosx", "ios" or "darwin". These three valid darwin are now returned by a static function: lldbtest.getDarwinOSTriples() Fixed up all places that has 'if self.getPlatform() == "darwin":' with "if self.platformIsDarwin()" and all instances of 'if self.getPlatform() != "darwin":' with "if not self.platformIsDarwin()". I also fixed some darwin decorator functions to do the right thing as well. llvm-svn: 233933
* Update sys.platform switched behavior in tests to use self.getPlatform ↵Robert Flack2015-04-013-3/+3
| | | | | | | | | | | | | | | | | | | | | | (remote target platform) Uses target platform when determining which platform specific behavior to use or expect in tests. TestHelp.py was unchanged because this is asserting behavior of the local lldb binary. Test Plan: Run tests on different remote os. Several previously failing tests now pass: TestArrayTypes.py TestInferiorChanged.py TestInferiorCrashing.py TestIvarProtocols.py TestProcessIO.py TestPublicAPIHeaders.py TestRecursiveInferior.py Differential Revision: http://reviews.llvm.org/D8747 llvm-svn: 233805
* Replace sys.platform skips in tests with @skip decorators which check ↵Robert Flack2015-03-3011-16/+16
| | | | | | | | | | | | | | | | against remote platform. Adds @skipIfPlatform and @skipUnlessPlatform decorators which will skip if / unless the target platform is in the provided platform list. Test Plan: ninja check-lldb shows no regressions. When running cross platform, tests which cannot run on the target platform are skipped. Differential Revision: http://reviews.llvm.org/D8665 llvm-svn: 233547
* xfail tests that failed with clang-3.7, gcc4.8.2 and on i386 to get buildbot ↵Ying Chen2015-03-251-0/+1
| | | | | | | | | | | | | | | | | | green Summary: -Refer to bug https://buganizer.corp.google.com/issues/19893563 -Test log http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/1145 Test Plan: Run tests with different compiler and archs locally Reviewers: sivachandra, ovyalov, chaoren, vharron Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8573 llvm-svn: 233157
* Fix error introduced by changing function signatures.Zachary Turner2015-03-241-0/+2
| | | | | | | | | | | | | | | | | Since ClangASTSource::layoutRecordType() was overriding a virtual function in the base, this was inadvertently causing a new method to be introduced rather than an override. To fix this all method signatures are changed back to taking DenseMaps, and the `override` keyword is added to make sure this type of error doesn't happen again. To keep the original fix intact, which is that fields and bases must be added in offset order, the ImportOffsetMap() function now copies the DenseMap into a vector and then sorts the vector on the value type (e.g. the offset) before iterating over the sorted vector and inserting the items. llvm-svn: 233099
* Fix record layout when synthesizing class types.Zachary Turner2015-03-241-2/+0
| | | | | | | | | | | | | | | | | Prior to this patch, we would try to synthesize class types by iterating over a DenseMap of FieldDecls and adding each one to a CXXRecordDecl. Since a DenseMap doesn't provide a deterministic ordering of the elements, this would not add the fields in FieldOffset order, but rather in some random order determined by the memory layout of the DenseMap. This patch fixes the issue by changing DenseMaps to vectors. The ability to lookup a value in the DenseMap was hardly being used, and where it is sufficient to do a vector lookup. Differential Revision: http://reviews.llvm.org/D8512 llvm-svn: 233090
* Remove obsolate rdar comment from TestSetValues.pyTamas Berghammer2015-03-171-2/+0
| | | | llvm-svn: 232490
* Fix makefiles to build shared library tests on Windows.Zachary Turner2015-03-131-4/+2
| | | | | | | | | | | | | | | Abstracted away some POSIX-isms that caused MAKE to issue invalid commands on Windows. Added a new force-include for the test programs so that we can use platform-specific macros. TestSharedLib now builds and cleans up on Windows, though the test still fails some of the expectations. Differential Revision: http://reviews.llvm.org/D8277 Patch by: Adrian McCarthy Issue Tracker: http://llvm.org/pr21727 llvm-svn: 232220
* Remove unnecessary platform specific code from TestGlobalVariables.Chaoren Lin2015-03-031-13/+1
| | | | llvm-svn: 231159
* [TestGlobalVariables] LD_LIBRARY_PATH should be process working directory.Chaoren Lin2015-03-031-2/+7
| | | | | | | | | | | | | | Summary: The inferior can load the library now, but the remote test is still failing because of a module loading problem in LLDB. Reviewers: ovyalov, sivachandra, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8038 llvm-svn: 231120
* Re-add makefiles of inline testsPavel Labath2015-02-121-0/+3
| | | | llvm-svn: 228925
* Add a JSON producer to LLDB - this is a set of classes that encapsulate JSON ↵Enrico Granata2015-02-101-3/+0
| | | | | | | | objects and allow you to write them to a Stream for subsequent processing Using this JSON producer, write a little tool that expands its own command-line arguments and dumps them to stdout as a JSON array llvm-svn: 228636
* Check-in generated test makefilesPavel Labath2015-02-051-0/+3
| | | | | | for rationale, see D7407. llvm-svn: 228314
* Adapt test for tid format on non-Darwin platformsEd Maste2015-01-301-1/+5
| | | | llvm-svn: 227580
* Fix a number of tests on Windows.Zachary Turner2015-01-141-0/+2
| | | | | | | These fix various issues with path handling and disable a few tests which use features of LLVM which are not yet supported on Windows. llvm-svn: 226042
* Fix several test failures on Linux/FreeBSD caused by compiler configuration ↵Oleksiy Vyalov2014-12-012-18/+4
| | | | | | | | and invalid environment - make lldbtest.registerSharedLibrariesWithTarget to support multiple platforms. http://reviews.llvm.org/D6392 llvm-svn: 223091
* Fix several test failures on Linux/FreeBSD caused by compiler configuration ↵Oleksiy Vyalov2014-11-262-16/+16
| | | | | | | | and invalid environment. http://reviews.llvm.org/D6392 llvm-svn: 222845
* Add decorator for test that fails on FreeBSD after editline reworkEd Maste2014-11-181-0/+1
| | | | | | llvm.org/21599 llvm-svn: 222245
* Fixes for remote test suite execution of the "lldb/test/lang" directory.Greg Clayton2014-11-176-31/+73
| | | | | | | | | Fixes include: - Add a new lldbtest.TestBase function named registerSharedLibrariesWithTarget. This function can be called using the shared libraries for your test suite either as shared library basename ("foo"), path basename ("libfoo.dylib") or full path ("/tmp/lldb/test/lang/c/carp/libfoo.dylib"). These shared libraries are then registered with the target so they will be downloaded when the test is run remotely. - Changed a lot of tests over to use SBDebugger::CreateTarget(...) calls instead of using "file a.out" commands. - Cleaned up some tests to add new locations for breakpoints that all compilers should be able to abide by. Some tests and constants being loaded into values of structs and some compilers like arm64 will often combine two constant data loads into a single source line so some breakpoint locations were not being set correctly. Adding lines like 'puts("")' allow us to lock onto a source line that will have code. llvm-svn: 222156
* Add decorator for failing null dereference test on FreeBSDEd Maste2014-11-121-0/+1
| | | | | | llvm.org/pr21550 llvm-svn: 221815
* Pick better floating point numbers (ones that can be exactly represented) in ↵Greg Clayton2014-11-062-9/+9
| | | | | | | | floating point instead of something that can't to avoid test suite failures on different devices and architectures. <rdar://problem/18826900> llvm-svn: 221468
* Add a few more bug IDs for x'fail test casesEnrico Granata2014-10-171-2/+1
| | | | llvm-svn: 220003
* Made multi-line test case actions possible inSean Callanan2014-10-171-2/+5
| | | | | | | the inline test cases. This makes them much more readable. llvm-svn: 220001
* Added a new kind of test case: the "inline" testSean Callanan2014-10-164-112/+5
| | | | | | | | | | | | | | | | | | | | | | | | case. This test case style attempts to shed all of the boilerplate that is required for test cases, and let 80% of test cases use a much terser syntax. Inline testcases have much simplified python files (the corresponding .py file should contain two lines of code) and require no Makefile, because the Makefile is generated automatically. Breakpoints are set automatically and the indicated breakpoint actions (specified after a magic //% comment) are executed when the breakpoint is hit. All other testcases are unaffected. One thing I'm not really happy with yet is the way multiple actions for the same line are specified. I'm going to use lang/c/struct_types as a guinea pig to develop this further. llvm-svn: 219984
* Associate a bug tracking ID with this test caseEnrico Granata2014-10-161-2/+2
| | | | llvm-svn: 219972
* This test actually works alright - we were just checking for the wrong stringEnrico Granata2014-10-161-4/+1
| | | | llvm-svn: 219971
* Get test executables compiling on Windows.Zachary Turner2014-08-131-1/+1
| | | | | | | | | | | | | | Many of the test executables use pthreads directly. This isn't portable on Windows, so this patch converts these test to use C++11 threads and mutexes. Since Windows' implementation of std::thread classes throw and catch from header files, this patch also disables exceptions when compiling with clang on Windows. Reviewed by: Todd Fiala, Ed Maste Differential Revision: http://reviews.llvm.org/D4816 llvm-svn: 215562
* Marked failing test XFAIL for ↵Todd Fiala2014-07-091-0/+1
| | | | | | | | TestRegisterVariables.test_with_dsym_and_run_command on Darwin See http://llvm.org/bugs/show_bug.cgi?id=20266 llvm-svn: 212648
* Make the fail messagesJim Ingham2014-04-031-1/+2
| | | | llvm-svn: 205497
* Work around clang's ignoring __attribute ( align(16) ) in this test case.Jim Ingham2014-03-191-1/+6
| | | | llvm-svn: 204207
* Modified some test annotations so that tests on Linux that should be skipped ↵Todd Fiala2014-03-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | don't show up as XFAIL. The following two tests showed up as XFAIL even though they should always be skipped on Linux, due to the @unittest2.expectedFailure annotation appearing above the @dsym_test annotation: TestObjCNewSyntax.ObjCNewSyntaxTestCase.test_expr_with_dsym TestBlocks.BlocksTestCase.test_expr_with_dsym. For those two, I simply moved the @dsym_test annotation to the top so that it would be marked for skip ahead of being marked for XFAIL. TestObjCNewSyntax.ObjCNewSyntaxTestCase.test_expr_with_dwarf I marked as @skipIfLinux since my understanding is that isn't a valid test to run on Linux. So rather than categorize as a fail (i.e. something wrong to be fixed), just skip it. (My recent changes to Linux tests have been following that model: if it could never work, skip; if it's broken, mark XFAIL so we can easily track, fix, notice the fix and adjust accordingly). TestDeadStrip.DeadStripTestCase.test_with_dwarf I had previously marked as XFAIL but this would never work on Linux with the current linker AFAICT. Marked it as skip. llvm-svn: 202788
* Converted TestRegisterVariables to run on Linux and skip with clang.Todd Fiala2014-02-281-1/+1
| | | | | | | | TestRegisterVariables.test_with_dwarf_and_run_command was being skipped on Linux due to issues with clang. I converted it to a @expectedFailureClang and no longer skip on Linux. llvm-svn: 202515
* Converted TestConstVariables expected failure to @expectedFailureClang.Todd Fiala2014-02-281-2/+1
| | | | | | | | | TestConstVariables.py was disabled on Linux and marked as unconditional expected failure. This change removes the Linux disable and makes the expected failure conditional on using clang. The test runs fine on gcc-built lldb. llvm-svn: 202514
* Added a test case for variables in registers, withSean Callanan2014-02-073-0/+120
| | | | | | | | clang -O1. <rdar://problem/15767528> llvm-svn: 201005
* Correctly set the working directory when launching processes for both local ↵Greg Clayton2013-12-135-5/+5
| | | | | | and remote targets. llvm-svn: 197266
* Massive test suite cleanup to stop everyone from manually having to compute ↵Greg Clayton2013-12-1017-17/+17
| | | | | | | | | | "mydir" inside each test case. This has led to many test suite failures because of copy and paste where new test cases were based off of other test cases and the "mydir" variable wasn't updated. Now you can call your superclasses "compute_mydir()" function with "__file__" as the sole argument and the relative path will be computed for you. llvm-svn: 196985
* test: Update decorators for FreeBSD failures with threaded inferior supportEd Maste2013-12-091-1/+0
| | | | | | | llvm.org/pr18190 llvm.org/pr18191 llvm-svn: 196792
* Update failing FreeBSD test annotations (pr17932, pr17933)Ed Maste2013-11-141-1/+1
| | | | | | | After solving the issue in llvm.org/pr17226 these two tests still fail, now for other reasons. llvm-svn: 194729
* This test is expected to fail pending proper supportEnrico Granata2013-10-311-0/+2
| | | | llvm-svn: 193831
* Tls test fails on FreeBSD due to llvm.org/pr16696Ed Maste2013-10-311-0/+1
| | | | | | (Threaded inferior debugging not yet available on FreeBSD.) llvm-svn: 193771
* Fixing TestAnonymous to build dwarf where it says it will.Andrew Kaylor2013-10-291-1/+1
| | | | llvm-svn: 193628
* ValueObject and SBValue's GetChildMemberWithName should look through ↵Jim Ingham2013-10-181-0/+43
| | | | | | | | | | anonymous structs and unions the same way that C would. <rdar://problem/11987906> llvm-svn: 193016
* Added support for reading thread-local storage variables, as defined using ↵Richard Mitton2013-10-174-0/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the __thread modifier. To make this work this patch extends LLDB to: - Explicitly track the link_map address for each module. This is effectively the module handle, not sure why it wasn't already being stored off anywhere. As an extension later, it would be nice if someone were to add support for printing this as part of the modules list. - Allow reading the per-thread data pointer via ptrace. I have added support for Linux here. I'll be happy to add support for FreeBSD once this is reviewed. OS X does not appear to have __thread variables, so maybe we don't need it there. Windows support should eventually be workable along the same lines. - Make DWARF expressions track which module they originated from. - Add support for the DW_OP_GNU_push_tls_address DWARF opcode, as generated by gcc and recent versions of clang. Earlier versions of clang (such as 3.2, which is default on Ubuntu right now) do not generate TLS debug info correctly so can not be supported here. - Understand the format of the pthread DTV block. This is where it gets tricky. We have three basic options here: 1) Call "dlinfo" or "__tls_get_addr" on the inferior and ask it directly. However this won't work on core dumps, and generally speaking it's not a good idea for the debugger to call functions itself, as it has the potential to not work depending on the state of the target. 2) Use libthread_db. This is what GDB does. However this option requires having a version of libthread_db on the host cross-compiled for each potential target. This places a large burden on the user, and would make it very hard to cross-debug from Windows to Linux, for example. Trying to build a library intended exclusively for one OS on a different one is not pleasant. GDB sidesteps the problem and asks the user to figure it out. 3) Parse the DTV structure ourselves. On initial inspection this seems to be a bad option, as the DTV structure (the format used by the runtime to manage TLS data) is not in fact a kernel data structure, it is implemented entirely in useerland in libc. Therefore the layout of it's fields are version and OS dependent, and are not standardized. However, it turns out not to be such a problem. All OSes use basically the same algorithm (a per-module lookup table) as detailed in Ulrich Drepper's TLS ELF ABI document, so we can easily write code to decode it ourselves. The only question therefore is the exact field layouts required. Happily, the implementors of libpthread expose the structure of the DTV via metadata exported as symbols from the .so itself, designed exactly for this kind of thing. So this patch simply reads that metadata in, and re-implements libthread_db's algorithm itself. We thereby get cross-platform TLS lookup without either requiring third-party libraries, while still being independent of the version of libpthread being used. Test case included. llvm-svn: 192922
* <rdar://problem/12042982>Enrico Granata2013-10-041-5/+2
| | | | | | | | | | | | | | | | | | | This radar extends the notion of one-liner summaries to automagically apply in a few interesting cases More specifically, this checkin changes the printout of ValueObjects to print on one-line (as if type summary add -c had been applied) iff: this ValueObject does not have a summary its children have no synthetic children its children are not a non-empty base class without a summary its children do not have a summary that asks for children to show up the aggregate length of all the names of all the children is <= 50 characters you did not ask to see the types during a printout your pointer depth is 0 This is meant to simplify the way LLDB shows data on screen for small structs and similarly compact data types (e.g. std::pair<int,int> anyone?) Feedback is especially welcome on how the feature feels and corner cases where we should apply this printout and don't (or viceversa, we are applying it when we shouldn't be) llvm-svn: 191996
* test: Update FreeBSD failure decoratorsEd Maste2013-09-131-0/+1
| | | | | | | | | | | | | | | llvm.org/pr15261 missing size for static arrays llvm.org/pr15278 expressions generating signals llvm.org/pr15824 thread states aren't properly maintained llvm.org/pr16696 threaded inferior debugging not yet on FreeBSD llvm.org/pr17214 inline stepping fails on FreeBSD llvm.org/pr17225 Clang assertion failure llvm.org/pr17226 frame info lost after failed expression evaluation llvm.org/pr17228 test timeout The first three are existing Linux issues that also affect FreeBSD. llvm-svn: 190698
* Rename test class to match test target languageEd Maste2013-09-131-1/+1
| | | | llvm-svn: 190695
* Set shared library path on FreeBSD as on Linux for testsEd Maste2013-09-091-2/+2
| | | | llvm-svn: 190286
* Set shared library path on FreeBSD as on Linux for testsEd Maste2013-09-092-2/+2
| | | | llvm-svn: 190285
* Expression evaluation works on FreeBSD after switch to MCJITEd Maste2013-08-302-2/+0
| | | | | | http://www.llvm.org/pr16697 llvm-svn: 189668
OpenPOWER on IntegriCloud