Commit Graph

37 Commits

Author SHA1 Message Date
Daniel Dunbar
a7193e40e2 lit: Fix exclude dirs functionality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89210 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 17:42:17 +00:00
Jeffrey Yasskin
d1ba06bf13 Make X86-64 in the Large model always emit 64-bit calls.
The large code model is documented at
http://www.x86-64.org/documentation/abi.pdf and says that calls should
assume their target doesn't live within the 32-bit pc-relative offset
that fits in the call instruction.

To do this, we turn off the global-address->target-global-address
conversion in X86TargetLowering::LowerCall(). The first attempt at
this broke the lazy JIT because it can separate the movabs(imm->reg)
from the actual call instruction. The lazy JIT receives the address of
the movabs as a relocation and needs to record the return address from
the call; and then when that call happens, it needs to patch the
movabs with the newly-compiled target. We could thread the call
instruction into the relocation and record the movabs<->call mapping
explicitly, but that seems to require at least as much new
complication in the code generator as this change.

To fix this, we make lazy functions _always_ go through a call
stub. You'd think we'd only have to force lazy calls through a stub on
difficult platforms, but that turns out to break indirect calls
through a function pointer. The right fix for that is to distinguish
between calls and address-of operations on uncompiled functions, but
that's complex enough to leave for someone else to do.

Another attempt at this defined a new CALL64i pseudo-instruction,
which expanded to a 2-instruction sequence in the assembly output and
was special-cased in the X86CodeEmitter's emitInstruction()
function. That broke indirect calls in the same way as above.

This patch also removes a hack forcing Darwin to the small code model.
Without far-call-stubs, the small code model requires things of the
JITMemoryManager that the DefaultJITMemoryManager can't provide.

Thanks to echristo for lots of testing!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88984 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 22:41:33 +00:00
Daniel Dunbar
2cb097d5cd lit: Factor a new OneCommandPerFileTest out of SyntaxCheckTest.
- Used for running a single fixed command on a directory of files, with the
   option of deriving a temporary input file from the test source.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88844 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 08:10:29 +00:00
Daniel Dunbar
048bac35df Remove duplicate implementation of excludes functionality, and support excluding
dirnames.

Also, add support for the 'unsupported' config property.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88838 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 07:22:58 +00:00
Daniel Dunbar
40c67b5832 lit: Add --repeat=N option, for running each test N times.
- Currently just useful for timing, although it could be extended as one (bad) way to deal with flaky tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 01:02:09 +00:00
Daniel Dunbar
6c1c9cfc65 lit: Add ExampleTests, for testing lit and demonstrating test suite features.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86654 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 02:41:17 +00:00
Daniel Dunbar
972cc05c23 lit: Fix bug in --show-suites which accidentally override the list of tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86653 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 02:40:21 +00:00
Daniel Dunbar
bf477df346 lit: Hardcode whence seek value, os.SEEK_END isn't always available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86449 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 09:07:33 +00:00
Daniel Dunbar
1bf013904f lit: Warn when a test suite contains no tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86448 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 09:07:26 +00:00
Daniel Dunbar
ee504b8cd7 lit: Drop require_and_and support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86447 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 09:07:13 +00:00
Daniel Dunbar
474f0df3ac lit: Workaround a Win32/subprocess bug when appending.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 03:43:06 +00:00
Daniel Dunbar
2d01b26ce7 lit: Preserve the PATHEXT variable when running subcommands, this is important on Win32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86436 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 03:35:19 +00:00
Douglas Gregor
489b83302c Teach lit's SyntaxCheckTest two new tricks:
- skip .svn directories
  - add a set of excluded filenames so we can easily skip tests



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86185 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05 22:58:04 +00:00
Daniel Dunbar
f626167e69 lit: Add --param NAME=VALUE option, for test suite specific use (to communicate
arbitrary command line arguments to the test suite).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86137 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05 16:27:33 +00:00
Daniel Dunbar
42543b7b73 lit: Update Clang's test style to use XFAIL: and XTARGET: lines that match
LLVM's tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85882 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 07:26:38 +00:00
Daniel Dunbar
edb8997821 lit: Add --config-prefix option, to override default config file names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85035 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 03:30:55 +00:00
Daniel Dunbar
6efba21342 lit: Allow use of /dev/null in redirects on Windows (replace by a temporary
file).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85028 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 01:37:26 +00:00
Dan Gohman
a7f1d72d09 Delete a spurious semicolon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85018 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 23:24:45 +00:00
Daniel Dunbar
a3f85d206a lit: Support '>>' redirections when executing scripts internally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85014 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 20:32:49 +00:00
Daniel Dunbar
7723d45153 lit: When running Tcl scripts via shell, try harder to find 'bash', but fall
back to running them internally if that fails. PR5240.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84462 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 03:54:21 +00:00
Jeffrey Yasskin
6bccb4c237 Support GoogleTest's "typed tests"
(http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide#Typed_Tests)
in lit.py.  These tests have names like "ValueMapTest/0.Iteration", which broke
when lit.py os.path.join()ed them onto the path and then assumed it could
os.path.split() them back off.  This patch shifts path components from the
testPath to the testName until the testPath exists.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84387 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 02:05:42 +00:00
Daniel Dunbar
705428ae4a Don't traverse into .svn directories.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82978 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 07:32:45 +00:00
Daniel Dunbar
5a461dd513 lit: When executing shell scripts internally, don't allow piped stderr on any
commands except the last one, instead redirect the stderr to a temporary
file. This sidesteps a potential deadlocking issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82538 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 09:50:38 +00:00
Daniel Dunbar
df3388492b Add a magic LLVM_DISABLE_CRT_DEBUG environment variable which we check in RegisterHandler and use to disable the Win32 crash dialogs. These are a major blocker to any kind of automated testing.
Also, tweak the 'lit' test runner to set this variable unconditionally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82537 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 09:50:28 +00:00
Daniel Dunbar
4b78aa3f56 Actually use the arguments with the resolved executable path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82527 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 06:09:13 +00:00
Daniel Dunbar
58c661ced1 lit: Don't use close_fds=True on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82521 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 04:44:37 +00:00
Daniel Dunbar
6bd2b2e9a2 lit: When executing commands internally, perform PATH resolution ourselves.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82520 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 04:44:26 +00:00
Daniel Dunbar
7c748661ce lit: Add a custom test format for use in clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81987 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 01:34:52 +00:00
Daniel Dunbar
b2485c9e41 lit: When finding nested test suites, check first in the execpath in case there
is a site configuration.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81902 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 20:09:17 +00:00
Daniel Dunbar
00a42449ec lit: Give test formats control over test discovery.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81751 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 02:38:46 +00:00
Daniel Dunbar
5110609ceb tests: Add a %abs_tmp substitution which is guaranteed to be a full path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81662 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 01:39:50 +00:00
Daniel Dunbar
c60535ab81 Count test correctly with -q.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81313 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 02:41:42 +00:00
Daniel Dunbar
07d0bd4da7 Fix another refactoro.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81312 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 02:41:32 +00:00
Daniel Dunbar
f072432e26 lit needs bash for tcl-as-sh execution, we use set -o pipefail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81197 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 06:08:07 +00:00
Daniel Dunbar
ba3931b667 Fix typo that worked on python 2.6.
Also, fix unit tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81194 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 05:46:28 +00:00
Daniel Dunbar
2c0a49c8cb Fix a refactoro.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81192 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 05:37:51 +00:00
Daniel Dunbar
be7ada7181 Add 'lit' testing tool.
- make install && man $(llvm-config --prefix)/share/man/man1/lit.1 for more
   information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81190 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 05:31:18 +00:00