Commit Graph

90 Commits

Author SHA1 Message Date
Enrico Granata f6fe302ee4 On Linux, if you can't actually locate the libc++ install, do not attempt to use it
The failure mode when one gets this wrong is quite gnarly to then walk oneself out of, and if you can't actually find the library, trying to build against it is fairly pointless anyway
This + my previous skip_if_library_missing change should make running the libc++ tests on a Linux machine without it much more seamless

llvm-svn: 248057
2015-09-18 22:26:34 +00:00
Chaoren Lin d761a9532b Fix Makefile for Windows to Android tests.
Reviewers: zturner

Subscribers: tberghammer, lldb-commits, danalbert

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

llvm-svn: 247857
2015-09-16 21:51:51 +00:00
Tamas Berghammer 1535bebac6 Remove the dwo files in the cleanup stage of the tests
The dwo files are generated when the tests run with split dwarf info.

llvm-svn: 247130
2015-09-09 10:20:30 +00:00
Zachary Turner 0844d8db4c On Windows, use 'del' instead of 'rm' to delete the test executable.
This is a nasty hack to work around the issue described in
https://llvm.org/pr24589

llvm-svn: 246062
2015-08-26 19:44:45 +00:00
Chaoren Lin 29449150e5 Update TestLoadUnload to use base Makefile.
Summary:
The current Makefile scheme only allows one dylib to be specified in each make
invocation, so TestLoadUnload had a custom Makefile that's unrelated to the
base Makefile.rules. This change uses recursive make invocations to bypass the
single dylib restriction. See D11202 for more context.

Reviewers: clayborg

Subscribers: chaoren, lldb-commits

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

llvm-svn: 242813
2015-07-21 17:50:16 +00:00
Chaoren Lin 9070f53079 Detect if necessary to build inferior with -pie for Android.
Summary:
- Add target_is_android check (with cached results).
- Make android_device_api also cache results.
- Also removes the need to pass --env OS=Android when testing against Android.

Reviewers: sivachandra, tberghammer, clayborg, danalbert

Subscribers: chaoren, tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 242580
2015-07-17 22:13:29 +00:00
Greg Clayton 5e3f20d791 Fixed the logic to determine the TRIPLE_VERSION correctly when it isn't specified.
llvm-svn: 238871
2015-06-02 21:42:31 +00:00
Greg Clayton 315b88d0cf Added the ability for the "make" command to take a triple:
% cd lldb/test/lang/c/array_types
% make TRIPLE=x86_64-apple-ios
% make clean
% make TRIPLE=x86_64-apple-ios8.1
% make clean
% make TRIPLE=armv7-apple-ios
% make clean
% make TRIPLE=armv7-apple-ios8.1
% make clean

The TRIPLE variable will automatically set the following variables:
    SDKROOT if it isn't specified manually
    ARCH will be set to the architecture from the triple
    CFLAGS will include the extras needed for the triple which are set in TRIPLE_CFLAGS
    TRIPLE_VENDOR set to the triple vendor ("apple" in the above cases)
    TRIPLE_OS set to the triple OS ("ios" in the above cases)
    TRIPLE_VERSION set to the version that was specified, or automatically set to the SDK version if it is missing

This allows you to change directory into any test case on MacOSX and quickly build for desktop:

% make

iOS simulator:

% make TRIPLE=x86_64-apple-ios

or iOS device:

% make TRIPLE=armv7-apple-ios

llvm-svn: 238869
2015-06-02 21:38:10 +00:00
Chaoren Lin 7d76a13bf3 Fix OBJCOPY and AR for Android.
Summary:
Previously, OBJCOPY was empty because of the missing comma,
and ar was just `ar`.

Reviewers: ovyalov, tberghammer

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 238849
2015-06-02 16:43:19 +00:00
Ed Maste 375432e4d8 Improve test for g++ 4.6
Skip the g++ 4.6 test if we're not going to build any C++ source.
If a test has C++ source files we automatically determine which C++
compiler to use based on $CC (for example, clang++ if CC=clang).
However, this is not done for tests without C++ source and CXX will
be GNU make's default of g++.  This produces suprious "g++: not found"
errors in testrun output on systems without a gcc/g++.

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

llvm-svn: 238603
2015-05-29 19:52:02 +00:00
Vince Harron 847e261e5d test Makefile.rules - pick a more sensible default CC on Linux
Differential Revision: http://reviews.llvm.org/D9920

llvm-svn: 238282
2015-05-27 04:42:54 +00:00
Chaoren Lin 36758cf16a Using -pthread instead of -lpthread to appease GCC.
llvm-svn: 237864
2015-05-21 00:19:15 +00:00
Ilia K feda0b7ea9 Disable GCC optimizations for builtin functions in lldb tests
This patch adds new default flag -fno-builtin which forces gcc to not optimize builtin functions.
For example, without this flag GCC replaces printf("hello\n") -> puts("hello") even if -O0 was specified

Also this patch fixes the MiDataTestCase.test_lldbmi_data_disassemble test on Linux/gcc.

llvm-svn: 237118
2015-05-12 12:13:12 +00:00
Vince Harron f2e3760ad8 Enabled libc++ formatter tests on Linux
Refactored TestInitializerList to not be an inline test.
Refactored Makefiles to use USE_LIBCPP instead of adding FLAGS directly
Fixed copy/paste error in TestDataFormatterUnordered class name

Differenttial Revision: http://reviews.llvm.org/D9426

llvm-svn: 236401
2015-05-04 02:56:32 +00:00
Robert Flack fa8aa172ad Allow specifying tool path/prefix for tests with CROSS_COMPILE.
CROSS_COMPILE environment variable is a common convention to specify the path
and/or prefix to cross compilation tools (e.g. ar, objcopy).

Test Plan:
dotest.py $DOTEST_OPTS -t -p 'TestBSDArchives.py|TestBreakpointCommandsFromPython.py|TestFormats.py|TestObjCDynamicValue.py'
All of these tests now compile successfully and pass running macosx -> linux
using a cross compilation toolchain prefixed by CROSS_COMPILE without requiring
changing your PATH. They still pass when run locally on macosx.

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

llvm-svn: 235320
2015-04-20 18:07:55 +00:00
Chaoren Lin 54fff4c9e2 Fix TestPluginCommands for gcc.
Summary: gcc requires that LDFLAGS come after DYLIB_OBJECTS.

Test Plan: TestPluginCommands passes.

Reviewers: sivachandra, pcc, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 235137
2015-04-16 22:03:43 +00:00
Greg Clayton 2c93b80f78 Make -arch work on MacOSX.
llvm-svn: 235065
2015-04-16 01:18:05 +00:00
Adrian McCarthy b4b8bb72cb Fix OS default in Makefile.rules for Windows. http://reviews.llvm.org/D9043
llvm-svn: 235056
2015-04-15 23:38:23 +00:00
Tamas Berghammer 23fc4b00a9 Fix test makefile after r234949.
On non OSX architectures we don't need a space between the arch flag
(-m) and the value.

llvm-svn: 234985
2015-04-15 09:28:31 +00:00
Greg Clayton 931b107364 MacOSX needs a space between $(ARCHFLAG) and $(ARCH) otherwise we try to call clang with "-archx86_64" which doesn't work.
llvm-svn: 234949
2015-04-14 22:08:17 +00:00
Chaoren Lin f4a92bda49 Missing `-lpthread` causes gcc test failure.
Summary:
`-lpthread` was removed for `g++ -std=c++11` on Linux due to llvm.org/pr21553,
but the original issue doesn't seem to be reproducible anymore. Even if it were,
it had nothing to do with compiling inferiors.

Reviewers: sbest, sivachandra, chying

Subscribers: lldb-commits

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

llvm-svn: 234770
2015-04-13 18:21:31 +00:00
Tamas Berghammer dcc8e595cb Use objcopy provided next to the compiler on android
Differential revision: http://reviews.llvm.org/D8765

llvm-svn: 233908
2015-04-02 11:09:28 +00:00
Zachary Turner 65fe1eb5f8 Tear down tests in reverse order from setting them up.
Tests derive from TestBase, which derives from Base.  In the
test setUp() methods, we always call TestBase.setUp() first and
then call implementation-specific setup.  Tear down needs to do
the reverse.

This was causing over 20 failures on Windows, and was the culprit
behind about 80% of the files not being cleaned up after test run.
TestBase.tearDown() is responsible for deleting all targets created
during the test run and without this step, on Windows files will
be locked and cannot be deleted.  But TestBase.tearDown() was
calling Base.tearDown() before its own cleanup (i.e. deleting the
targets) and in some cases one of the teardown hooks would be to
call make clean.  So make clean would be run before the targets
had been deleted, and fail to remove the files, and subsequently
result in a failed test as well.

llvm-svn: 233284
2015-03-26 16:43:25 +00:00
Robert Flack 666a986839 Don't clobber CFLAGS_EXTRAS in tests.
To run tests against a different target platform many extra compiler flags are
needed to specify sysroot, include dirs, etc. The environment variable
CFLAGS_EXTRAS seems suited for this purpose except that several Makefiles
clobber the current flags. This change modifies all of these to add to
CFLAGS_EXTRAS instead.

Test Plan:
Verify no regressions in ninja check-lldb.
Run tests using CFLAGS_EXTRAS to specify cross compilation flags for a different
target running lldb-server platform.

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

llvm-svn: 233066
2015-03-24 12:41:20 +00:00
Zachary Turner 794e6a60a8 Fix makefiles to build shared library tests on Windows.
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
2015-03-13 21:51:11 +00:00
Tamas Berghammer 1e209fcceb Create NativeRegisterContext for android-arm64
Differential revision: http://reviews.llvm.org/D8058

llvm-svn: 232160
2015-03-13 11:36:47 +00:00
Tamas Berghammer 37099e87cb Fix global makefiles for the tests to support android
Two changes are required to compile the tests for android
* Disable the usage of -lpthread as it is included by default on
  android
* Add -pie to the linker flags because android only support position
  independent executables

Differential revision: http://reviews.llvm.org/D7856

llvm-svn: 230487
2015-02-25 13:02:08 +00:00
Pavel Labath f81ed47a07 Clean up dependency .d.$$$$ files for tests
Summary:
Mac-only tests were leaving .d.$$$$ dependency files left in the test tree. This happened
because:
1) "make clean" was invoked although no tests in the folder were run
2) The Makefile had main.d as a dependency, which meant it tried to compile the source file (to extract
dependencies).
3) The compile failed (does not compile on linux) and left behind a main.d.$$$$ temporary file.
4) "make clean" tried to clean up these temporary files, but the expansion $(wildcard *.d.[0-9]*)
was performed before the temporary file was created, so this file was not caught.

I fix this by giving all the temporary files deterministic names, which makes it easier to clean
them up afterwards. I also make the rules for generating the dependency files more robust and
less likely to leak files in the first place.

Reviewers: vharron, zturner

Subscribers: lldb-commits

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

llvm-svn: 228285
2015-02-05 09:52:42 +00:00
Kate Stone 2136ace961 Fixed a makefile rule used by several tests
Now quotes dsymutil path, required when running tests where the toolchain is in a path that contains a space

llvm-svn: 226695
2015-01-21 19:30:00 +00:00
Zachary Turner 3e9ca3a625 Delete MSVC intermediate files on "make clean" from tests.
lld-link shells out to MSVC for certain types of work, and this
results in some MSVC output files being generated even though
clang / lld are the compiler / linker.  This is expected, so we
make sure to clean these output files on make clean.

llvm-svn: 224345
2014-12-16 16:48:19 +00:00
Zachary Turner e068d91824 Link test executables with LLD on Windows.
Clang generates DWARF debug info with section names longer
than 8 characters.  This is only supported by an extension
to PE/COFF which the MSVC linker doesn't implement.  So
trying to link DWARF-enabled object files with MSVC will
lead to corrupt debug information in the executable.

llvm-svn: 223088
2014-12-01 23:13:41 +00:00
Enrico Granata 489af08f67 Allow dsymutil to exists in a path with spaces in it
llvm-svn: 222276
2014-11-18 22:47:33 +00:00
Shawn Best 954eae0ed4 add Makefile rule for test program CREATE_STD_THREADS
Effectively removes -lpthreads from linux/gcc build of test programs in test/api/multithreaded. This was done due to that combination causing a test program to hang due, likely due to an issue with gcc linker and libstdc++ conflicting pthreads code in test program and pthread used by lldb.  Issue has been documented at:
http://llvm.org/bugs/show_bug.cgi?id=21553

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

llvm-svn: 222031
2014-11-14 19:41:33 +00:00
Justin Hibbits 3cba1c267d Add powerpc support for the test suite.
Reviewed by Ed Maste at MeetBSD.

llvm-svn: 221787
2014-11-12 15:13:58 +00:00
Shawn Best 1ecb68d5ce Substitute cc with c++ when compiling c++ test files for Siva Chandra : http://reviews.llvm.org/D6199
llvm-svn: 221692
2014-11-11 17:34:58 +00:00
Ed Maste 6bc862dcf5 Use consistent capitalization for ENABLE_THREADS in tests
llvm-svn: 215565
2014-08-13 18:27:12 +00:00
Zachary Turner c7826524ac Get test executables compiling on Windows.
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
2014-08-13 17:44:53 +00:00
Zachary Turner 7c1bc2b8ae Make CMake choose the target architecture according to the build.
Previously, CMake was invoking the test runner and not specifying
what architecture to use when building test executables.  The
Makefiles for the test executables then had logic to choose x64
by default.  This doesn't work on Windows because the test compiler
would then try to link against the 64-bit MSVCRT and not find them
since only the 32-bit MSVCRT was in the path.

This patch addresses this by figuring out, at CMake time, whether
or not you are building LLDB with a 64 or 32-bit toolchain.  Then,
it explicitly passes this value to the test runner, causing the
test runner to build tests whose architecture matches that of LLDB
itself.  This can still be overridden by setting the CMake variable
LLDB_TEST_EXECUTABLE_ARCH=(x64|x86)

llvm-svn: 214443
2014-07-31 21:07:41 +00:00
Zachary Turner 7d186c0152 Remove shell-globbing from all test makefiles.
llvm-svn: 214441
2014-07-31 21:03:11 +00:00
Greg Clayton 82625d3a5f Use the most up to date dsymutil on Darwin, not the one in /usr/bin/dsymutil.
llvm-svn: 214207
2014-07-29 20:10:59 +00:00
Jim Ingham 4b4b2478fc This commit reworks how the thread plan's ShouldStopHere mechanism works, so that it is useful not only
for customizing "step-in" behavior (e.g. step-in doesn't step into code with no debug info), but also 
the behavior of step-in/step-out and step-over when they step out of the frame they started in.

I also added as a proof of concept of this reworking a mode for stepping where stepping out of a frame
into a frame with no debug information will continue stepping out till it arrives at a frame that does
have debug information.  This is useful when you are debugging callback based code where the callbacks
are separated from the code that initiated them by some library glue you don't care about, among other
things.

llvm-svn: 203747
2014-03-13 02:47:14 +00:00
Jason Molenda 53b8ea1c89 Need to use rm -rf on dSYM bundle directories.
llvm-svn: 203332
2014-03-08 01:53:27 +00:00
Ed Maste c5a3c9f483 Use predefined $(RM) in clean rule, and -r only for (expected) directories
llvm-svn: 203271
2014-03-07 19:11:00 +00:00
Ed Maste 0990e05d43 Fix test 'make clean' target for empty $(DSYM) on FreeBSD
A freebsd issue with rm prevents '[g]make clean' from working if $(DSYM)
is empty (fts_open(3) fails if passed an empty argument).

To work around this, simplify the clean target by using three separate
rm invocations: one for the common files, one for the case of non-empty
$(DYLIB_NAME), and one for non-empty $(DSYM).

Issue diagnosed (and reported to FreeBSD) by John Wolfe.

llvm.org/pr17933

llvm-svn: 203253
2014-03-07 17:20:50 +00:00
Ed Maste 4fe0aba12b On FreeBSD "x86_64" is spelled "amd64"
llvm-svn: 201802
2014-02-20 18:40:01 +00:00
Greg Clayton b39751bc9f Patch from Todd Fiala for http://llvm.org/bugs/show_bug.cgi?id=17961
llvm-svn: 195500
2013-11-22 21:05:25 +00:00
Richard Mitton ec8b282bde Rearranged linker flags for test suite.
Some linkers (GNU ld) are picky about library order, so if we import libraries as part of our LDFLAGS then that needs to come after any DYLIB_NAME which might require that library.

llvm-svn: 192917
2013-10-17 20:09:33 +00:00
Matt Kopec 7663b3a9d0 Add support for TestPluginComands on Linux. Also, rework makefile dsym target.
llvm-svn: 191383
2013-09-25 17:44:00 +00:00
Stefanus Du Toit f1620efc4a Use the correct compiler to compute dependencies.
This uses $(CXX) instead of $(CC) to generate the .d files for tests built
with Makefiles.

llvm-svn: 187426
2013-07-30 17:33:30 +00:00
Matt Kopec f2430f5d2d Fix test suite make so that -std=c++11 gets set properly for supported compilers and -std=c++0x gets set only for gcc 4.6 versions. Previously, -std=c++0x was being set for all compilers.
llvm-svn: 187080
2013-07-24 21:39:24 +00:00