Commit Graph

232 Commits

Author SHA1 Message Date
Alp Toker
04ae34b0aa Provide a test input for opt
This was only working previously due to a quirk in the way lit
concatenates script commands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194078 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-05 13:57:34 +00:00
Alp Toker
e794e41c35 Quote potential shell expansions found in tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193558 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-28 23:37:45 +00:00
NAKAMURA Takumi
94400d4a4e llvm/test/Other/close-stderr.ll: Remove "XFAIL:win32". It reverts r173509.
"REQUIRES: shell" should cover if this failed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193458 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-26 02:50:14 +00:00
Bill Wendling
80075c482c Update to remove the no-frame-pointer-elim-non-leaf flag if it was set to 'false'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189068 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-22 21:28:54 +00:00
Matt Arsenault
80f495aab0 Teach ConstantFolding about pointer address spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188831 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-20 21:20:04 +00:00
Daniel Dunbar
24ec2e5a72 [tests] Cleanup initialization of test suffixes.
- Instead of setting the suffixes in a bunch of places, just set one master
   list in the top-level config. We now only modify the suffix list in a few
   suites that have one particular unique suffix (.ml, .mc, .yaml, .td, .py).

 - Aside from removing the need for a bunch of lit.local.cfg files, this enables
   4 tests that were inadvertently being skipped (one in
   Transforms/BranchFolding, a .s file each in DebugInfo/AArch64 and
   CodeGen/PowerPC, and one in CodeGen/SI which is now failing and has been
   XFAILED).

 - This commit also fixes a bunch of config files to use config.root instead of
   older copy-pasted code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188513 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-16 00:37:11 +00:00
Rafael Espindola
c1bb2d4325 Use pipefail when available.
This change makes test with RUN lines like
RUN: opt ... | FileCheck

fail if opt fails, even if it prints what FileCheck wants. Enabling this
found some interesting cases of broken tests that were not being noticed
because opt (or some other tool) was crashing late.

Pipefail is used when the shell supports it or when using the internal
python based tester.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187261 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-26 22:32:58 +00:00
NAKAMURA Takumi
2cf5425d0a Windows/Path.inc: Introduce file_type::character_file and file_type::fifo_file in sys::fs::getStatus(HANDLE).
It fixes llvm/test/Other/close-stderr.ll on msys.

FIXME: Provide unittests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186588 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-18 17:00:54 +00:00
Reid Kleckner
431b0a7646 [Support] Beef up and expose the response file parsing in llvm::cl
The plan is to use it for clang and lld.

Major behavior changes:
- We can now parse UTF-16 files that have a byte order mark.
- PR16209: Don't drop backslashes on the floor if they don't escape
  anything.

The actual parsing loop was based on code from Clang's driver.cpp,
although it's been rewritten to track its state with control flow rather
than state variables.

Reviewers: hans

Differential Revision: http://llvm-reviews.chandlerc.com/D1170

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186587 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-18 16:52:05 +00:00
NAKAMURA Takumi
3ece065dd6 llvm/test/Other/close-stderr.ll: Mark this as XFAIL on msys, since r186560.
sys::fs::status() doesn't work on pipes. Investigating.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186586 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-18 15:38:50 +00:00
Rafael Espindola
394f3b4281 XFAIL this test on mingw.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186444 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-16 19:20:29 +00:00
Rafael Espindola
67f9b377ba Create files with mode 666. This matches the behavior of other unix tools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186414 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-16 14:10:07 +00:00
Hal Finkel
ce9681422a Move r186044 tests into CodeGen/X86
I had thought that these tests could be target-neutral, but in practice this is
not the case (on some targets, like Hexagon and Darwin), they trigger an assert
(a different assert than the one that r186044 fixes).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186051 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-11 01:55:55 +00:00
Hal Finkel
fe532525cc Set REQUIRES shell on the test cases for r186044
Trying to fix the i686-mingw32 build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186046 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-10 23:25:03 +00:00
Hal Finkel
627190ed78 XFAIL the test cases for r186044 on Hexagon
For some reason, the Hexagon backend does not reject these invalid static
initializer expressions, but instead crashes in AsmPrinter::EmitGlobalConstant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186045 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-10 23:11:14 +00:00
Hal Finkel
10050d19e8 Don't assert if we can't constant fold extract/insertvalue
A non-constant-foldable static initializer expression containing insertvalue or
extractvalue had been causing an assert:

  Constants.cpp:1971: Assertion `FC && "ExtractValue constant expr couldn't be
                                 folded!"' failed.

Now we report a more-sensible "Unsupported expression in static initializer"
error instead.

Fixes PR15417.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186044 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-10 22:51:01 +00:00
NAKAMURA Takumi
3b7e9787aa llvm/test/Other/llvm-cov.test: It requires +Asserts to let XFAILed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185799 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 08:44:24 +00:00
Matt Beaumont-Gay
1a84066b8c (1) Add ".test" to test/Other/lit.local.cfg, so llvm-cov.test is actually run.
(2) Rename llvm-cov test inputs so the string "llvm-cov" doesn't get
substituted by lit within the input filenames on the RUN line.
(3) XFAIL llvm-cov.test because it asserts:
include/llvm/ADT/SmallVector.h:140: reference llvm::SmallVectorTemplateCommon<llvm::GCOVBlock *, void>::operator[](unsigned int) [T = llvm::GCOVBlock *]: Assertion `begin() + idx < end()' failed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185358 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-01 18:58:53 +00:00
NAKAMURA Takumi
7e980a6845 Suppress llvm/test/Other/can-execute.txt on msys bash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184932 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26 10:56:44 +00:00
Rafael Espindola
b6a633ca94 Add a testcase for r184074.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184080 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-17 14:00:41 +00:00
Benjamin Kramer
e94e4ca5fd Attributes: Don't print trailing whitespace on the function attribute comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179849 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19 11:43:21 +00:00
Lang Hames
880e8c0ad4 Check isDiscardableIfUnused, rather than hasLocalLinkage, when bumping
GlobalValue linkage up to ExternalLinkage in the ExtractGV pass. This
prevents linkonce and linkonce_odr symbols from being DCE'd.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176459 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-04 22:40:44 +00:00
Meador Inge
8df7c39976 IR: Don't constant fold GEP bitcasts between different address spaces
PR15262 reported a bug where the following instruction:

  i8 getelementptr inbounds i8* bitcast ([4 x i8] addrspace(12)* @buf to i8*),
                                i32 2

was getting folded into:

  addrspace(12)* getelementptr inbounds ([4 x i8] addrspace(12)* @buf, i32 0,
                                        i32 2)

This caused instcombine to crash because the original instruction and
the folded instruction have different types.  The issue was fixed by
disallowing bitcasts between different address spaces to be folded away.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176156 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27 02:26:42 +00:00
Bill Wendling
7ab6c76ad1 Modify the LLVM assembly output so that it uses references to represent function attributes.
This makes the LLVM assembly look better. E.g.:

     define void @foo() #0 { ret void }
     attributes #0 = { nounwind noinline ssp }


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175605 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-20 07:21:42 +00:00
Reid Kleckner
1eb5aea504 XFAIL close-stderr on win32
The test runner does not rewrite instances of /dev/null inside the
quoted sh command.  /dev/null does not exist, so opt will fail to open
it, and return a non-zero exit code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173509 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 22:12:54 +00:00
NAKAMURA Takumi
fe311dba3e llvm/test/Other/close-stderr.ll: Mark this as XFAIL:valgrind. We got 127 instead of 1 here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172956 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 03:35:39 +00:00
Rafael Espindola
811a837609 Using "not grep" is brittle as the test passes if llvm-as fails.
Fix the testcase to be valid IL and uses FileCheck.
Thanks to NAKAMURA Takumi for noticing it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168427 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-21 14:17:23 +00:00
NAKAMURA Takumi
2aac6161e4 Revert r167836, "llvm/test/Other/close-stderr.ll: Mark it as XFAIL:mingw32 for now.", corresponding to r167849.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167876 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-13 21:57:42 +00:00
Chad Rosier
fc298c76c7 Revert 167755/167760. We don't want to emit crash diagnostics on command-line syntax errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167849 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-13 16:42:19 +00:00
NAKAMURA Takumi
90c61c4a74 llvm/test/Other/close-stderr.ll: Mark it as XFAIL:mingw32 for now.
On MSYS, 70 is not seen, but 1.

r127726 should be reworked. Candidate options are;

  1) Use not exit(70), but _exit(70), in report_fatal_error().
  2) Return with _exit(70) in ~raw_ostream().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167836 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-13 15:03:33 +00:00
Chad Rosier
fa77cced0b Update test case for r167754/r167755.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167760 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-12 21:51:08 +00:00
Chandler Carruth
ece6c6bb63 Revert the series of commits starting with r166578 which introduced the
getIntPtrType support for multiple address spaces via a pointer type,
and also introduced a crasher bug in the constant folder reported in
PR14233.

These commits also contained several problems that should really be
addressed before they are re-committed. I have avoided reverting various
cleanups to the DataLayout APIs that are reasonable to have moving
forward in order to reduce the amount of churn, and minimize the number
of commits that were reverted. I've also manually updated merge
conflicts and manually arranged for the getIntPtrType function to stay
in DataLayout and to be defined in a plausible way after this revert.

Thanks to Duncan for working through this exact strategy with me, and
Nick Lewycky for tracking down the really annoying crasher this
triggered. (Test case to follow in its own commit.)

After discussing with Duncan extensively, and based on a note from
Micah, I'm going to continue to back out some more of the more
problematic patches in this series in order to ensure we go into the
LLVM 3.2 branch with a reasonable story here. I'll send a note to
llvmdev explaining what's going on and why.

Summary of reverted revisions:

r166634: Fix a compiler warning with an unused variable.
r166607: Add some cleanup to the DataLayout changes requested by
         Chandler.
r166596: Revert "Back out r166591, not sure why this made it through
         since I cancelled the command. Bleh, sorry about this!
r166591: Delete a directory that wasn't supposed to be checked in yet.
r166578: Add in support for getIntPtrType to get the pointer type based
         on the address space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167221 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01 08:07:29 +00:00
Rafael Espindola
ca88ceea52 Add -alias and -ralias options to match what we have for functions and
globals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166909 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 02:23:07 +00:00
Rafael Espindola
9cb90e7c15 llvm-extract changes linkages so that functions on both sides of the
split module can see each other. If it is keeping a symbol that already has
a non local linkage, it doesn't need to change it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166908 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 01:59:03 +00:00
Rafael Espindola
c0916d30e0 llvm-extract was unable to handle aliases. It would leave a copy on the
output of both

llvm-extract foo.ll -func=bar
and
llvm-extract foo.ll -func=bar -delete

so the two new files could not be linked together anymore. With this change
alias are handled almost like functions and global variables. Almost because
with alias we cannot just clear the initializer/body, we have to create a new
declaration and replace the alias with it.

The net result is that now the output of the above commands can be linked
even if foo.ll has aliases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166907 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 00:27:55 +00:00
Rafael Espindola
e5551ed9ce Change the internalize pass to internalize all symbols when given an empty
list of externals. This makes sense since a shared library with no symbols
can still be useful if it has static constructors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166795 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26 18:47:48 +00:00
Micah Villmow
aa76e9e2cf Add in support for getIntPtrType to get the pointer type based on the address space.
This checkin also adds in some tests that utilize these paths and updates some of the
clients.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166578 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24 15:52:52 +00:00
Rafael Espindola
b4e971f376 Enable response files in all tools. Patch by Liu, Yaxun (Sam). I have simplified
the test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165535 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 19:52:10 +00:00
Micah Villmow
7744345a71 Forgot the SPIR test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164949 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-01 17:07:51 +00:00
Duncan Sands
b620469223 Ignore apparent buffer overruns on external or weak globals. This is a major
source of false positives due to globals being declared in a header with some
kind of incomplete (small) type, but the actual definition being bigger.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164912 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-30 07:30:10 +00:00
Duncan Sands
c7c42f71aa Teach the 'lint' sanity checking pass to detect simple buffer overflows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164671 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-26 07:45:36 +00:00
Duncan Sands
00edf4c1d8 Change the way the lint sanity checking pass detects misaligned memory accesses.
Previously it was only be able to detect problems if the pointer was a numerical
value (eg inttoptr i32 1 to i32*), but not if it was an alloca or globa.  The
reason was the use of ComputeMaskedBits: imagine you have "alloca i8, align 2",
and ask ComputeMaskedBits what it knows about the bits of the alloca pointer.
It can tell you that the bottom bit is known zero (due to align 2) but it can't
tell you that bit 1 is known one.  That's because the address could be an even
multiple of 2 rather than an odd multiple, eg it might be a multiple of 4.  Thus
trying to use KnownOne is ineffective in the case of an alloca as it will never
have any bits set.  Instead look explicitly for constant offsets from allocas
and globals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164595 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-25 10:00:49 +00:00
Nick Lewycky
85aa4f6eee Don't do actual work inside an assert statement. Fixes PR11760!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164474 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-23 03:58:21 +00:00
Benjamin Kramer
30ce40e3f7 FileCheck: Fix off-by-one bug that made CHECK-NOT: ignore the next character after the colon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164165 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18 20:51:39 +00:00
Jan Sjödin
18505b3522 Add hidden flag to exclude aliases from output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164158 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18 18:47:58 +00:00
Chandler Carruth
1de43ede89 Fix the remaining TCL-style quotes found in the testsuite. This is
another mechanical change accomplished though the power of terrible Perl
scripts.

I have manually switched some "s to 's to make escaping simpler.

While I started this to fix tests that aren't run in all configurations,
the massive number of tests is due to a really frustrating fragility of
our testing infrastructure: things like 'grep -v', 'not grep', and
'expected failures' can mask broken tests all too easily.

Essentially, I'm deeply disturbed that I can change the testsuite so
radically without causing any change in results for most platforms. =/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159547 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 19:09:46 +00:00
Chandler Carruth
49589f0d0e Convert the uses of '|&' to use '2>&1 |' instead, which works on old
versions of Bash. In addition, I can back out the change to the lit
built-in shell test runner to support this.

This should fix the majority of fallout on Darwin, but I suspect there
will be a few straggling issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159544 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 18:37:59 +00:00
Chandler Carruth
c0fdba955a The built-in shell test runner for some reason doesn't like the quoting
and multi-line nature of this test. I don't really feel like bugging
this kind of edge-case, so just put it on one line and use single
quotes. With this, every test *really* passes with the built-in shell
test runner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159530 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 13:35:01 +00:00
Chandler Carruth
4177e6fff5 Convert all tests using TCL-style quoting to use shell-style quoting.
This was done through the aid of a terrible Perl creation. I will not
paste any of the horrors here. Suffice to say, it require multiple
staged rounds of replacements, state carried between, and a few
nested-construct-parsing hacks that I'm not proud of. It happens, by
luck, to be able to deal with all the TCL-quoting patterns in evidence
in the LLVM test suite.

If anyone is maintaining large out-of-tree test trees, feel free to poke
me and I'll send you the steps I used to convert things, as well as
answer any painful questions etc. IRC works best for this type of thing
I find.

Once converted, switch the LLVM lit config to use ShTests the same as
Clang. In addition to being able to delete large amounts of Python code
from 'lit', this will also simplify the entire test suite and some of
lit's architecture.

Finally, the test suite runs 33% faster on Linux now. ;]
For my 16-hardware-thread (2x 4-core xeon e5520): 36s -> 24s

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159525 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 12:47:22 +00:00
Chandler Carruth
8bc3434e68 Teach the 'opt' tool about '-Os' and '-Oz', corresponding to the Clang
options, to enable easier testing of the innards of LLVM that are
enabled by such optimization strategies.

Note that this doesn't provide the (much needed) function attribute
support for -Oz (as opposed to -Os), but still seems like a positive
step to better test the logic that Clang currently relies on.

Patch by Patrik Hägglund.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156913 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-16 08:32:49 +00:00
Dan Gohman
03e091f0b5 Reapply r155682, making constant folding more consistent, with a fix to work
properly with how the code handles all-undef PHI nodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155721 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-27 17:50:22 +00:00
NAKAMURA Takumi
d213ee7643 Revert r155682, "Use ConstantExpr::getExtractElement when constant-folding vectors"
It broke stage2 build. stage1/clang sometimes crashed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155699 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-27 07:59:20 +00:00
Dan Gohman
97b44f9b80 Use ConstantExpr::getExtractElement when constant-folding vectors
instead of getAggregateElement. This has the advantage of being
more consistent and allowing higher-level constant folding to
procede even if an inner extract element cannot be folded.

Make ConstantFoldInstruction call ConstantFoldConstantExpression
on the instruction's operands, making it more consistent with 
ConstantFoldConstantExpression itself. This makes sure that
ConstantExprs get TargetData-aware folding before being handed
off as operands for further folding.

This causes more expressions to be folded, but due to a known
shortcoming in constant folding, this currently has the side effect
of stripping a few more nuw and inbounds flags in the non-targetdata
side of constant-fold-gep.ll. This is mostly harmless.

This fixes rdar://11324230.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155682 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-27 00:54:36 +00:00
Eli Bendersky
cc85160672 Continue cleanup of LIT, getting rid of the remaining artifacts from dejagnu
* Removed test/lib/llvm.exp - it is no longer needed 
* Deleted the dg.exp reading code from test/lit.cfg. There are no dg.exp files
  left in the test suite so this code is no longer required. test/lit.cfg is
  now much shorter and clearer 
* Removed a lot of duplicate code in lit.local.cfg files that need access to
  the root configuration, by adding a "root" attribute to the TestingConfig
  object. This attribute is dynamically computed to provide the same
  information as was previously provided by the custom getRoot functions. 
* Documented the config.root attribute in docs/CommandGuide/lit.pod





git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153408 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-25 09:02:19 +00:00
Eli Bendersky
0f0c411079 Replace all instances of dg.exp file with lit.local.cfg, since all tests are run with LIT now and now Dejagnu. dg.exp is no longer needed.
Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150664 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 06:28:33 +00:00
Bill Wendling
4b523b4371 Update test to new EH model.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149332 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 02:04:20 +00:00
Manuel Klimek
5bb210e134 Deleting the json-bench-test until I understand why it is flaky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146821 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 06:29:32 +00:00
Manuel Klimek
76f13017fc Adds a JSON parser and a benchmark (json-bench) to catch performance regressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146735 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 13:09:10 +00:00
Eli Friedman
3ba19b1045 Fix test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146642 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 04:52:47 +00:00
Eli Friedman
adeb0a6e64 Make constant folding for GEPs a bit more aggressive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146639 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 04:33:48 +00:00
Chris Lattner
d2bf432b2b Upgrade syntax of tests using volatile instructions to use 'load volatile' instead of 'volatile load', which is archaic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145171 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-27 06:54:59 +00:00
Bill Wendling
a29a6b9a6c Update to new EH scheme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138906 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-31 21:44:24 +00:00
Chris Lattner
1afcace3a3 Land the long talked about "type system rewrite" patch. This
patch brings numerous advantages to LLVM.  One way to look at it
is through diffstat:
 109 files changed, 3005 insertions(+), 5906 deletions(-)

Removing almost 3K lines of code is a good thing.  Other advantages
include:

1. Value::getType() is a simple load that can be CSE'd, not a mutating
   union-find operation.
2. Types a uniqued and never move once created, defining away PATypeHolder.
3. Structs can be "named" now, and their name is part of the identity that
   uniques them.  This means that the compiler doesn't merge them structurally
   which makes the IR much less confusing.
4. Now that there is no way to get a cycle in a type graph without a named
   struct type, "upreferences" go away.
5. Type refinement is completely gone, which should make LTO much MUCH faster
   in some common cases with C++ code.
6. Types are now generally immutable, so we can use "Type *" instead 
   "const Type *" everywhere.

Downsides of this patch are that it removes some functions from the C API,
so people using those will have to upgrade to (not yet added) new API.  
"LLVM 3.0" is the right time to do this.

There are still some cleanups pending after this, this patch is large enough
as-is.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134829 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 17:41:24 +00:00
Galina Kistanova
6f0b5e4a22 Move platform-dependent test to appropriate directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131302 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-13 19:45:05 +00:00
Stuart Hastings
007cfce220 Move this test to CodeGen/Thumb. rdar://problem/9416774
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131196 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-11 19:41:28 +00:00
Stuart Hastings
e8b9f16a4c Reduced test case. rdar://problem/9416774
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131191 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-11 17:29:25 +00:00
Stuart Hastings
de5d5ded64 And lo, I was given a testcase for 131152. rdar://problem/9416774
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131184 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-11 16:00:21 +00:00
NAKAMURA Takumi
50004bedfa test/Other/close-stderr.ll: Require the feature 'shell'. It is not executable on Win32 but it is executable on MSYS-bash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121105 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 02:43:58 +00:00
Dan Gohman
c1be92f3bb Make BasicAliasAnalysis a normal AliasAnalysis implementation which
does normal initialization and normal chaining. Change the default
AliasAnalysis implementation to NoAlias.

Update StandardCompileOpts.h and friends to explicitly request
BasicAliasAnalysis.

Update tests to explicitly request -basicaa.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116720 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-18 18:04:47 +00:00
Devang Patel
d82e9e7d93 Remove LoopIndexSplit pass. It is neither maintained nor used by anyone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116004 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-07 23:29:37 +00:00
Bob Wilson
edf017487f Fix llvm-extract so that it changes the linkage of all GlobalValues to
"external" even when doing lazy bitcode loading.  This was broken because
a function that is not materialized fails the !isDeclaration() test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 17:25:06 +00:00
Dan Gohman
be2d4e77b5 Fix llvm-extract -delete's lazy loading to materialize the functions that
will not be deleted, rather than the ones that will.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114614 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 00:33:13 +00:00
Jakob Stoklund Olesen
61ca48e0da XFAIL test under valgrind. It is not really our problem if sh is leaking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113550 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 22:02:13 +00:00
Chris Lattner
61c70e98ac remove unions from LLVM IR. They are severely buggy and not
being actively maintained, improved, or extended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112356 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-28 04:09:24 +00:00
Chandler Carruth
f90ab07c35 Try to escape the '$'s in these so they reach the underlying 'sh' invocation.
I have no idea how lit did the right thing here, but other test runners don't.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111805 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 08:54:19 +00:00
Dan Gohman
e0b313d599 Add a testcase to verify that commands don't crash when they hit
errors on stderr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111440 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 22:35:56 +00:00
Dan Gohman
9883b95a2b Revert r111058, the lint check for indirectbr successors that aren't
address-taken. This can occur normally, if the code which took the
address got DCEd.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111121 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 14:39:19 +00:00
Dan Gohman
61556e3a94 Add a lint check for an indirectbr destination which has not
had its address taken.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111058 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 23:56:28 +00:00
Dan Gohman
a8afb2a623 Add a lint check for indirectbr with no successors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110074 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 23:06:43 +00:00
Benjamin Kramer
38ca1078b4 Remove XFAIL, test doesn't leak anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109801 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 20:36:36 +00:00
Dan Gohman
545d00645c Add a lint check for mismatched return types, inspired by PR6944.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108162 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 18:02:04 +00:00
Dan Gohman
c185a12f25 Don't write a file named "&1".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106269 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-18 01:49:17 +00:00
Dan Gohman
aec2a0dbce Add lint checks for function attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105009 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 21:43:57 +00:00
Dan Gohman
13ec30b6a1 Fix lint's memcpy and memmove checks, and its basic block traversal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104970 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 17:44:00 +00:00
Dan Gohman
17d95965cb Detect self-referential values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104957 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 16:45:33 +00:00
Dan Gohman
34220aedc4 Remove this va_arg test, which is no longer applicable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 16:44:04 +00:00
Dan Gohman
078f8595b5 Eli pointed out that va_arg instruction result values don't
reference the stack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104951 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 16:34:49 +00:00
Dan Gohman
ff26d4e9ce Teach lint how to look through simple store+load pairs and other
effective no-op constructs, to make it more effective on
unoptimized IR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104950 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 16:21:24 +00:00
Dan Gohman
292fc87fe2 Add a lint check for returning the address of stack memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104936 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 04:33:42 +00:00
Gabor Greif
2893a460d8 rename test to represent meaningful date
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104831 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 09:32:38 +00:00
Dan Gohman
882ddb492d Reinstate checking of stackrestore, with checking for both Read
and Write, and add a comment explaining this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104756 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-26 22:21:25 +00:00
Dan Gohman
113b3e2c6e Implement checking of the tail keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104744 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-26 21:46:36 +00:00
Daniel Dunbar
bd616b69f7 XFAIL the test I added with vg_leak, apparently it is the first and only llc
-filetype=obj test, and -filetype=obj leaks a few objects. Added a FIXME, we
need to sort out the ownership model for the various MC objects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103769 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-14 07:47:51 +00:00
Daniel Dunbar
d11d59e35a Inline Asm: Ensure buffer is newline terminated to match how the text is printed.
- This is a hack, but I can't decide the best place to handle this. Chris?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103765 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-14 04:31:50 +00:00
Chris Lattner
e24b5c52d6 this really is needed. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103434 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 21:23:48 +00:00
Chris Lattner
ea9f0b8c35 just remove this, it isn't needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103432 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 21:01:47 +00:00
Chris Lattner
c279243128 fix a pretty obvious typo. We test things before committing them, right?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103427 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 20:51:06 +00:00
David Greene
e89f1c4ee7 Fix PR6875:
This includes a patch by Roman Divacky to fix the initial crash.

Move the actual addition of passes from *PassManager::add to
*PassManager::addImpl.  That way, when adding printer passes we won't
recurse infinitely.

Finally, check to make sure that we are actually adding a FunctionPass
to a FunctionPassManager before doing a print before or after it.
Immutable passes are strange in this way because they aren't
FunctionPasses yet they can be and are added to the FunctionPassManager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103425 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 20:24:27 +00:00
Dan Gohman
5b61b3818a Add lint checks for invalid uses of memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102733 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30 19:05:00 +00:00
Dan Gohman
be02b20a8f Add several more lint checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100841 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 01:39:53 +00:00