1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

313 Commits

Author SHA1 Message Date
Yuchen Wu
18826c61b5 Removed llvm-cov.test from Other folder.
More comprehensive llvm-cov tests were added to tools/llvm-cov.

llvm-svn: 197175
2013-12-12 20:29:54 +00:00
Rafael Espindola
524e7f35de Add a fixed version of r195470 back.
The fix is simply to use CurI instead of I when handling aliases to
avoid accessing a invalid iterator.

original message:

Convert linkonce* to weak* instead of strong.

Also refactor the logic into a helper function. This is an important improve
on mingw where the linker complains about mixed weak and strong symbols.
Converting to weak ensures that the symbol is not dropped, but keeps in a
comdat, making the linker happy.

llvm-svn: 195477
2013-11-22 17:58:12 +00:00
Rafael Espindola
749aa1e00d Revert "Convert linkonce* to weak* instead of strong."
This reverts commit r195470.
Debugging failure in some bots.

llvm-svn: 195472
2013-11-22 17:09:34 +00:00
Rafael Espindola
2ac1404bee Convert linkonce* to weak* instead of strong.
Also refactor the logic into a helper function. This is an important improvement
on mingw where the linker complains about mixed weak and strong symbols.
Converting to weak ensures that the symbol is not dropped, but keeps in a
comdat, making the linker happy.

llvm-svn: 195470
2013-11-22 16:14:30 +00:00
Matt Arsenault
9921608896 Add addrspacecast instruction.
Patch by Michele Scandale!

llvm-svn: 194760
2013-11-15 01:34:59 +00:00
Alp Toker
c85bedbb15 Provide a test input for opt
This was only working previously due to a quirk in the way lit
concatenates script commands.

llvm-svn: 194078
2013-11-05 13:57:34 +00:00
Alp Toker
d1073c1f24 Quote potential shell expansions found in tests
llvm-svn: 193558
2013-10-28 23:37:45 +00:00
NAKAMURA Takumi
fc1b5e7959 llvm/test/Other/close-stderr.ll: Remove "XFAIL:win32". It reverts r173509.
"REQUIRES: shell" should cover if this failed.

llvm-svn: 193458
2013-10-26 02:50:14 +00:00
Bill Wendling
fa2b06a7e7 Update to remove the no-frame-pointer-elim-non-leaf flag if it was set to 'false'.
llvm-svn: 189068
2013-08-22 21:28:54 +00:00
Matt Arsenault
474ae7ebd0 Teach ConstantFolding about pointer address spaces
llvm-svn: 188831
2013-08-20 21:20:04 +00:00
Daniel Dunbar
a496d61c01 [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.

llvm-svn: 188513
2013-08-16 00:37:11 +00:00
Rafael Espindola
2cf6d36f16 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.

llvm-svn: 187261
2013-07-26 22:32:58 +00:00
NAKAMURA Takumi
c3862f9446 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.
llvm-svn: 186588
2013-07-18 17:00:54 +00:00
Reid Kleckner
c1af8a0511 [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

llvm-svn: 186587
2013-07-18 16:52:05 +00:00
NAKAMURA Takumi
b0f5532d43 llvm/test/Other/close-stderr.ll: Mark this as XFAIL on msys, since r186560.
sys::fs::status() doesn't work on pipes. Investigating.

llvm-svn: 186586
2013-07-18 15:38:50 +00:00
Rafael Espindola
0e87cce1d6 XFAIL this test on mingw.
llvm-svn: 186444
2013-07-16 19:20:29 +00:00
Rafael Espindola
3a0a77998b Create files with mode 666. This matches the behavior of other unix tools.
llvm-svn: 186414
2013-07-16 14:10:07 +00:00
Hal Finkel
e4c36bd8fb 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).

llvm-svn: 186051
2013-07-11 01:55:55 +00:00
Hal Finkel
a874b8226d Set REQUIRES shell on the test cases for r186044
Trying to fix the i686-mingw32 build.

llvm-svn: 186046
2013-07-10 23:25:03 +00:00
Hal Finkel
082c25c501 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.

llvm-svn: 186045
2013-07-10 23:11:14 +00:00
Hal Finkel
6d75832312 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.

llvm-svn: 186044
2013-07-10 22:51:01 +00:00
NAKAMURA Takumi
146f6c2ba7 llvm/test/Other/llvm-cov.test: It requires +Asserts to let XFAILed.
llvm-svn: 185799
2013-07-08 08:44:24 +00:00
Matt Beaumont-Gay
aae6843783 (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.

llvm-svn: 185358
2013-07-01 18:58:53 +00:00
NAKAMURA Takumi
927f436b5d Suppress llvm/test/Other/can-execute.txt on msys bash.
llvm-svn: 184932
2013-06-26 10:56:44 +00:00
Rafael Espindola
699a9ec3ab Add a testcase for r184074.
llvm-svn: 184080
2013-06-17 14:00:41 +00:00
Benjamin Kramer
ff677123a0 Attributes: Don't print trailing whitespace on the function attribute comment.
llvm-svn: 179849
2013-04-19 11:43:21 +00:00
Lang Hames
ba8dee024f 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.

llvm-svn: 176459
2013-03-04 22:40:44 +00:00
Meador Inge
c24a74205b 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.

llvm-svn: 176156
2013-02-27 02:26:42 +00:00
Bill Wendling
74351693ea 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 }

llvm-svn: 175605
2013-02-20 07:21:42 +00:00
Reid Kleckner
c8ef60e375 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.

llvm-svn: 173509
2013-01-25 22:12:54 +00:00
NAKAMURA Takumi
7da1a315d8 llvm/test/Other/close-stderr.ll: Mark this as XFAIL:valgrind. We got 127 instead of 1 here.
llvm-svn: 172956
2013-01-20 03:35:39 +00:00
Rafael Espindola
03adaab74d 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.

llvm-svn: 168427
2012-11-21 14:17:23 +00:00
NAKAMURA Takumi
3250911d1e Revert r167836, "llvm/test/Other/close-stderr.ll: Mark it as XFAIL:mingw32 for now.", corresponding to r167849.
llvm-svn: 167876
2012-11-13 21:57:42 +00:00
Chad Rosier
abe41c8f95 Revert 167755/167760. We don't want to emit crash diagnostics on command-line syntax errors.
llvm-svn: 167849
2012-11-13 16:42:19 +00:00
NAKAMURA Takumi
cb05f68b6c 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().

llvm-svn: 167836
2012-11-13 15:03:33 +00:00
Chad Rosier
fe86a11392 Update test case for r167754/r167755.
llvm-svn: 167760
2012-11-12 21:51:08 +00:00
Chandler Carruth
76f7f4a33e 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.
llvm-svn: 167221
2012-11-01 08:07:29 +00:00
Rafael Espindola
f030658478 Add -alias and -ralias options to match what we have for functions and
globals.

llvm-svn: 166909
2012-10-29 02:23:07 +00:00
Rafael Espindola
c460831626 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.

llvm-svn: 166908
2012-10-29 01:59:03 +00:00
Rafael Espindola
218ef13219 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.

llvm-svn: 166907
2012-10-29 00:27:55 +00:00
Rafael Espindola
4b51029c9e 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.

llvm-svn: 166795
2012-10-26 18:47:48 +00:00
Micah Villmow
521311700f 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.

llvm-svn: 166578
2012-10-24 15:52:52 +00:00
Rafael Espindola
8e5adfa32c Enable response files in all tools. Patch by Liu, Yaxun (Sam). I have simplified
the test.

llvm-svn: 165535
2012-10-09 19:52:10 +00:00
Micah Villmow
892471fb4c Forgot the SPIR test case.
llvm-svn: 164949
2012-10-01 17:07:51 +00:00
Duncan Sands
751f9472f2 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.

llvm-svn: 164912
2012-09-30 07:30:10 +00:00
Duncan Sands
3e1f8917ba Teach the 'lint' sanity checking pass to detect simple buffer overflows.
llvm-svn: 164671
2012-09-26 07:45:36 +00:00
Duncan Sands
45a436ffcb 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.

llvm-svn: 164595
2012-09-25 10:00:49 +00:00
Nick Lewycky
ac620030a2 Don't do actual work inside an assert statement. Fixes PR11760!
llvm-svn: 164474
2012-09-23 03:58:21 +00:00
Benjamin Kramer
9958678403 FileCheck: Fix off-by-one bug that made CHECK-NOT: ignore the next character after the colon.
llvm-svn: 164165
2012-09-18 20:51:39 +00:00
Jan Sjödin
f6acd91dcf Add hidden flag to exclude aliases from output.
llvm-svn: 164158
2012-09-18 18:47:58 +00:00
Chandler Carruth
5d3a0ce4e5 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. =/

llvm-svn: 159547
2012-07-02 19:09:46 +00:00
Chandler Carruth
d200829a4f 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.

llvm-svn: 159544
2012-07-02 18:37:59 +00:00
Chandler Carruth
eafc1e5909 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.

llvm-svn: 159530
2012-07-02 13:35:01 +00:00
Chandler Carruth
8a358b3669 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

llvm-svn: 159525
2012-07-02 12:47:22 +00:00
Chandler Carruth
6bc19df503 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.

llvm-svn: 156913
2012-05-16 08:32:49 +00:00
Dan Gohman
25a863dcf7 Reapply r155682, making constant folding more consistent, with a fix to work
properly with how the code handles all-undef PHI nodes.

llvm-svn: 155721
2012-04-27 17:50:22 +00:00
NAKAMURA Takumi
a28147f072 Revert r155682, "Use ConstantExpr::getExtractElement when constant-folding vectors"
It broke stage2 build. stage1/clang sometimes crashed.

llvm-svn: 155699
2012-04-27 07:59:20 +00:00
Dan Gohman
a72b2f97a6 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.

llvm-svn: 155682
2012-04-27 00:54:36 +00:00
Eli Bendersky
3ef88c1833 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

llvm-svn: 153408
2012-03-25 09:02:19 +00:00
Eli Bendersky
4afdeeb682 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.

llvm-svn: 150664
2012-02-16 06:28:33 +00:00
Bill Wendling
8402993dd4 Update test to new EH model.
llvm-svn: 149332
2012-01-31 02:04:20 +00:00
Manuel Klimek
09f4d148b8 Deleting the json-bench-test until I understand why it is flaky.
llvm-svn: 146821
2011-12-17 06:29:32 +00:00
Manuel Klimek
2f7cf4e64b Adds a JSON parser and a benchmark (json-bench) to catch performance regressions.
llvm-svn: 146735
2011-12-16 13:09:10 +00:00
Eli Friedman
09abc453ac Fix test.
llvm-svn: 146642
2011-12-15 04:52:47 +00:00
Eli Friedman
f6ae3a7caf Make constant folding for GEPs a bit more aggressive.
llvm-svn: 146639
2011-12-15 04:33:48 +00:00
Chris Lattner
9d1e8420ff Upgrade syntax of tests using volatile instructions to use 'load volatile' instead of 'volatile load', which is archaic.
llvm-svn: 145171
2011-11-27 06:54:59 +00:00
Bill Wendling
e540c593ec Update to new EH scheme.
llvm-svn: 138906
2011-08-31 21:44:24 +00:00
Chris Lattner
a106725fc5 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.

llvm-svn: 134829
2011-07-09 17:41:24 +00:00
Galina Kistanova
9df62fe3e4 Move platform-dependent test to appropriate directory.
llvm-svn: 131302
2011-05-13 19:45:05 +00:00
Stuart Hastings
1d08224543 Move this test to CodeGen/Thumb. rdar://problem/9416774
llvm-svn: 131196
2011-05-11 19:41:28 +00:00
Stuart Hastings
50900ef566 Reduced test case. rdar://problem/9416774
llvm-svn: 131191
2011-05-11 17:29:25 +00:00
Stuart Hastings
eebfe36090 And lo, I was given a testcase for 131152. rdar://problem/9416774
llvm-svn: 131184
2011-05-11 16:00:21 +00:00
NAKAMURA Takumi
f260cf36f0 test/Other/close-stderr.ll: Require the feature 'shell'. It is not executable on Win32 but it is executable on MSYS-bash.
llvm-svn: 121105
2010-12-07 02:43:58 +00:00
Dan Gohman
6aff5b94ff 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.

llvm-svn: 116720
2010-10-18 18:04:47 +00:00
Devang Patel
35201e0fd6 Remove LoopIndexSplit pass. It is neither maintained nor used by anyone.
llvm-svn: 116004
2010-10-07 23:29:37 +00:00
Bob Wilson
0fdee121f7 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.

llvm-svn: 114666
2010-09-23 17:25:06 +00:00
Dan Gohman
007957687e Fix llvm-extract -delete's lazy loading to materialize the functions that
will not be deleted, rather than the ones that will.

llvm-svn: 114614
2010-09-23 00:33:13 +00:00
Jakob Stoklund Olesen
79f7387096 XFAIL test under valgrind. It is not really our problem if sh is leaking.
llvm-svn: 113550
2010-09-09 22:02:13 +00:00
Chris Lattner
ecf276b787 remove unions from LLVM IR. They are severely buggy and not
being actively maintained, improved, or extended.

llvm-svn: 112356
2010-08-28 04:09:24 +00:00
Chandler Carruth
49b7cdd14c 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.

llvm-svn: 111805
2010-08-23 08:54:19 +00:00
Dan Gohman
7bfc030c1e Add a testcase to verify that commands don't crash when they hit
errors on stderr.

llvm-svn: 111440
2010-08-18 22:35:56 +00:00
Dan Gohman
8ed4d1646e 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.

llvm-svn: 111121
2010-08-16 14:39:19 +00:00
Dan Gohman
422c164d8d Add a lint check for an indirectbr destination which has not
had its address taken.

llvm-svn: 111058
2010-08-13 23:56:28 +00:00
Dan Gohman
abb2503036 Add a lint check for indirectbr with no successors.
llvm-svn: 110074
2010-08-02 23:06:43 +00:00
Benjamin Kramer
23151050ce Remove XFAIL, test doesn't leak anymore.
llvm-svn: 109801
2010-07-29 20:36:36 +00:00
Dan Gohman
0af129aa1b Add a lint check for mismatched return types, inspired by PR6944.
llvm-svn: 108162
2010-07-12 18:02:04 +00:00
Dan Gohman
6c3d683d19 Don't write a file named "&1".
llvm-svn: 106269
2010-06-18 01:49:17 +00:00
Dan Gohman
fe69bf7b4c Add lint checks for function attributes.
llvm-svn: 105009
2010-05-28 21:43:57 +00:00
Dan Gohman
a20b0d02e6 Fix lint's memcpy and memmove checks, and its basic block traversal.
llvm-svn: 104970
2010-05-28 17:44:00 +00:00
Dan Gohman
9a50a9215c Detect self-referential values.
llvm-svn: 104957
2010-05-28 16:45:33 +00:00
Dan Gohman
0108e13d6c Remove this va_arg test, which is no longer applicable.
llvm-svn: 104956
2010-05-28 16:44:04 +00:00
Dan Gohman
8570c1a249 Eli pointed out that va_arg instruction result values don't
reference the stack.

llvm-svn: 104951
2010-05-28 16:34:49 +00:00
Dan Gohman
7981165281 Teach lint how to look through simple store+load pairs and other
effective no-op constructs, to make it more effective on
unoptimized IR.

llvm-svn: 104950
2010-05-28 16:21:24 +00:00
Dan Gohman
a6c568fa77 Add a lint check for returning the address of stack memory.
llvm-svn: 104936
2010-05-28 04:33:42 +00:00
Gabor Greif
2bb2087a69 rename test to represent meaningful date
llvm-svn: 104831
2010-05-27 09:32:38 +00:00
Dan Gohman
2c70e05105 Reinstate checking of stackrestore, with checking for both Read
and Write, and add a comment explaining this.

llvm-svn: 104756
2010-05-26 22:21:25 +00:00
Dan Gohman
6b78ee79c1 Implement checking of the tail keyword.
llvm-svn: 104744
2010-05-26 21:46:36 +00:00
Daniel Dunbar
3c261b3ff8 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.

llvm-svn: 103769
2010-05-14 07:47:51 +00:00
Daniel Dunbar
26fa01eb86 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?

llvm-svn: 103765
2010-05-14 04:31:50 +00:00
Chris Lattner
a0f98775e9 this really is needed. :(
llvm-svn: 103434
2010-05-10 21:23:48 +00:00
Chris Lattner
bf56c070f3 just remove this, it isn't needed.
llvm-svn: 103432
2010-05-10 21:01:47 +00:00
Chris Lattner
b3d401532c fix a pretty obvious typo. We test things before committing them, right?
llvm-svn: 103427
2010-05-10 20:51:06 +00:00
David Greene
dec8f8b802 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.

llvm-svn: 103425
2010-05-10 20:24:27 +00:00
Dan Gohman
6944fae2f6 Add lint checks for invalid uses of memory.
llvm-svn: 102733
2010-04-30 19:05:00 +00:00
Dan Gohman
b07151b5dd Add several more lint checks.
llvm-svn: 100841
2010-04-09 01:39:53 +00:00
Dan Gohman
eeb89ac6d3 Add a few more lint checks.
llvm-svn: 100825
2010-04-08 23:05:57 +00:00
Dan Gohman
6ad805d335 Add a -lint pass which checks for common sources of undefined or likely
unintended behavior.

llvm-svn: 100798
2010-04-08 18:47:09 +00:00
Dan Gohman
d9d4889ccc Constant-fold GEP-of-GEP into a single GEP.
llvm-svn: 98178
2010-03-10 19:31:51 +00:00
Dan Gohman
7fa1298057 Fix whitespace.
llvm-svn: 98173
2010-03-10 19:00:54 +00:00
Chris Lattner
04209058b9 stop using anders-aa
llvm-svn: 97492
2010-03-01 20:24:50 +00:00
Dan Gohman
a15e497d94 Teach the constant folder about union types.
llvm-svn: 97142
2010-02-25 16:45:19 +00:00
Dan Gohman
ff8027e33a Canonicalize sizeof and alignof on pointer types to a canonical
pointer type.

llvm-svn: 95769
2010-02-10 06:13:07 +00:00
Dan Gohman
dd6702be8f Factor out alignof expression folding into a separate function and
generalize it to handle more cases.

llvm-svn: 95045
2010-02-02 01:41:39 +00:00
Dan Gohman
0b2c2769ba Generalize target-independent folding rules for sizeof to handle more
cases, and implement target-independent folding rules for alignof and
offsetof. Also, reassociate reassociative operators when it leads to
more folding.

Generalize ScalarEvolution's isOffsetOf to recognize offsetof on
arrays. Rename getAllocSizeExpr to getSizeOfExpr, and getFieldOffsetExpr
to getOffsetOfExpr, for consistency with analagous ConstantExpr routines.

Make the target-dependent folder promote GEP array indices to
pointer-sized integers, to make implicit casting explicit and exposed
to subsequent folding.

And add a bunch of testcases for this new functionality, and a bunch
of related existing functionality.

llvm-svn: 94987
2010-02-01 18:27:38 +00:00
Dan Gohman
0dc9176f36 Remove the folding rule
getelementptr (i8* inttoptr (i64 1 to i8*), i32 -1) 
  to
  inttoptr (i64 0 to i8*)
from the VMCore constant folder. It didn't handle sign-extension properly
in the case where the source integer is smaller than a pointer size. And,
it relied on an assumption about sizeof(i8).

The Analysis constant folder still folds these kinds of things; it has
access to TargetData, so it can do them right.

Add a testcase which tests that the VMCore constant folder doesn't
miscompile this, and that the Analysis folder does fold it.

llvm-svn: 94750
2010-01-28 18:08:26 +00:00
Dan Gohman
71fc5e8fce -disable-output is no longer needed with -analyze.
llvm-svn: 94574
2010-01-26 19:25:59 +00:00
Chris Lattner
c3905a79e4 fix bogus test
llvm-svn: 93069
2010-01-09 19:24:49 +00:00
Dan Gohman
5fa04f2707 Delete useless trailing semicolons.
llvm-svn: 92740
2010-01-05 17:55:26 +00:00
Dan Gohman
06621f065a Update these tests to match what Loop::print now prints.
llvm-svn: 85021
2009-10-24 23:52:07 +00:00
Nick Lewycky
554eac4066 Forbid arrays of function-type and structures with function-typed fields.
While I'm there, change code that does:
  SomeTy == Type::getFooType(Context)
into:
  SomeTy->getTypeID() == FooTyID
to decrease the amount of useless type creation which may involve locking, etc.

llvm-svn: 81846
2009-09-15 06:28:26 +00:00
Dan Gohman
c9307490ce Eliminate more redundant llvm-as calls.
llvm-svn: 81540
2009-09-11 18:17:12 +00:00
Dan Gohman
205b641954 Change tests from "opt %s" to "opt < %s" so that opt doesn't see the
input filename so that opt doesn't print the input filename in the
output so that grep lines in the tests don't unintentionally match
strings in the input filename.

llvm-svn: 81537
2009-09-11 18:01:28 +00:00
Dan Gohman
c95df8b6d8 Use opt -S instead of piping bitcode output through llvm-dis.
llvm-svn: 81257
2009-09-08 22:34:10 +00:00
Dan Gohman
8d84372836 Change these tests to feed the assembly files to opt directly, instead
of using llvm-as, now that opt supports this.

llvm-svn: 81226
2009-09-08 16:50:01 +00:00
Devang Patel
8d170194e8 Add new function attribute - noimplicitfloat
Update code generator to use this attribute and remove NoImplicitFloat target option.
Update llc to set this attribute when -no-implicit-float command line option is used.

llvm-svn: 72959
2009-06-05 21:57:13 +00:00
Dan Gohman
5f6f8101d5 Split the Add, Sub, and Mul instruction opcodes into separate
integer and floating-point opcodes, introducing
FAdd, FSub, and FMul.

For now, the AsmParser, BitcodeReader, and IRBuilder all preserve
backwards compatability, and the Core LLVM APIs preserve backwards
compatibility for IR producers. Most front-ends won't need to change
immediately.

This implements the first step of the plan outlined here:
http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt

llvm-svn: 72897
2009-06-04 22:49:04 +00:00
Devang Patel
7fa69ef109 Update call graph after inlining invoke.
Patch by Jay Foad.

llvm-svn: 68120
2009-03-31 17:36:12 +00:00
Dan Gohman
9385e139d0 Update another test for the LoopInfo::print changes.
llvm-svn: 65598
2009-02-27 00:20:19 +00:00
Duncan Sands
9014e7b0dd Testcase for PR2894.
llvm-svn: 57604
2008-10-15 22:34:34 +00:00
Devang Patel
ca66d093c0 Remove interfaces implemented by dead pass from the list of available passes.
Patch By Matthijs Kooijman.

llvm-svn: 57202
2008-10-06 20:36:36 +00:00
Duncan Sands
2c9f6ab06d Rationalize the names of passes that print information:
-callgraph => print-callgraph
    -callscc   => print-callgraph-sccs
    -cfgscc    => print-cfg-sccs
    -externalfnconstants => print-externalfnconstants
    -print               => print-function
    -print-alias-sets (no change)
    -print-callgraph     => dot-callgraph
    -print-cfg           => dot-cfg
    -print-cfg-only      => dot-cfg-only
    -print-dom-info (no change)
    -printm              => print-module
    -printusedtypes      => print-used-types

llvm-svn: 56487
2008-09-23 12:47:39 +00:00
Duncan Sands
aaa27f4261 Teach -callgraph to always print the callgraph (as the
description says it does), not just when -analyze is
used as well.  This means printing to stderr, so adjust
some tests.

llvm-svn: 56337
2008-09-19 07:57:09 +00:00
Owen Anderson
42c1d6c7b9 Remove GCSE and LoadVN from the testsuite.
llvm-svn: 54832
2008-08-16 00:00:54 +00:00
Devang Patel
b5abdd4c33 The pass manager is not able to schedule -loop-deletion -loop-index-split.
The loop-deletion pass does not preserve dom frontier, which is required by
loop-index-split. When the PM checks dom frontier for loop-index-split, it has
already verified that lcssa is availalble. However, new dom frontier forces new
loop pass manager, which does not  have lcssa yet.

The PM should recheck availability of required analysis passes in such cases.

llvm-svn: 54805
2008-08-14 23:07:48 +00:00
Duncan Sands
ac8ddfc48d Test this differently: I saw this test fail
because opt exited while llvm-as was still
writing to the pipe, causing it to get a
SIGPIPE.  It seems best to change things to
avoid the race altogether.

llvm-svn: 54138
2008-07-28 19:09:01 +00:00
Bill Wendling
3be8dca83f Put CPPBackend tests into their own directory and run them only if they're
supported.

llvm-svn: 53427
2008-07-10 22:35:32 +00:00
Matthijs Kooijman
15ab3c5f19 Let some more tests ignore expected output on stderr.
Also, use > %t instead of -o %t for output in one test since that also works
when %t already exists.

This fixes 6 testcases.

llvm-svn: 52178
2008-06-10 15:04:14 +00:00
Duncan Sands
5a6c6a92c1 Change packed struct layout so that field sizes
are the same as in unpacked structs, only field
positions differ.  This only matters for structs
containing x86 long double or an apint; it may
cause backwards compatibility problems if someone
has bitcode containing a packed struct with a
field of one of those types.
The issue is that only 10 bytes are needed to
hold an x86 long double: the store size is 10
bytes, but the ABI size is 12 or 16 bytes (linux/
darwin) which comes from rounding the store size
up by the alignment.  Because it seemed silly not
to pack an x86 long double into 10 bytes in a
packed struct, this is what was done.  I now
think this was a mistake.  Reserving the ABI size
for an x86 long double field even in a packed
struct makes things more uniform: the ABI size is
now always used when reserving space for a type.
This means that developers are less likely to
make mistakes.  It also makes life easier for the
CBE which otherwise could not represent all LLVM
packed structs (PR2402).
Front-end people might need to adjust the way
they create LLVM structs - see following change
to llvm-gcc.

llvm-svn: 51928
2008-06-04 08:21:45 +00:00
Gabor Greif
807c2df887 sabre brings to my attention that the 'tr' suffix is also obsolete
llvm-svn: 51349
2008-05-20 21:00:03 +00:00
Gabor Greif
d8a4dbb5da Rename the last test with .llx extension to .ll, resolve duplicate test by renaming to isnan2. Now that no test has llx ending there is no need to search for them from dg.exp too.
llvm-svn: 51328
2008-05-20 19:52:04 +00:00
Anton Korobeynikov
d6ec8965f7 Fix tests due to llvm2cpp move to llc target
llvm-svn: 50191
2008-04-23 22:41:53 +00:00
Devang Patel
e4f39224eb Keep track of analysis information inherited from Module pass manager.
llvm-svn: 48576
2008-03-20 01:09:53 +00:00
Dan Gohman
8d536a33ff Fix a bug that caused opt and other tools to silently ignore
invalid command-line options.

llvm-svn: 47523
2008-02-23 01:55:25 +00:00
Chris Lattner
8880d6ba5b dead pass
llvm-svn: 47324
2008-02-19 07:58:11 +00:00
Tanya Lattner
169eaef57b Remove llvm-upgrade and update tests.
llvm-svn: 47297
2008-02-19 01:44:26 +00:00
Devang Patel
01f9252f73 Fix PR2028
llvm-svn: 47150
2008-02-15 01:24:49 +00:00
Devang Patel
952baa25c2 New test.
llvm-svn: 41799
2007-09-10 18:12:52 +00:00
Dan Gohman
794fa1f8f7 Convert tests using "| wc -l | grep ..." to use the count script.
llvm-svn: 41097
2007-08-15 13:36:28 +00:00
Devang Patel
aba2f3de85 Fix PR1539. Add LoopPassPrinter.
llvm-svn: 37909
2007-07-05 15:32:03 +00:00
John Criswell
57e5ed4b5a Convert .cvsignore files
llvm-svn: 37801
2007-06-29 16:35:07 +00:00
Devang Patel
9eeed9a5bd Fix PR 1526.
llvm-svn: 37780
2007-06-28 23:09:25 +00:00
Devang Patel
0fb99e08a9 Update. Now, -etforest is an invalid option.
llvm-svn: 37767
2007-06-27 22:58:12 +00:00
Nick Lewycky
d498cbd4a9 Call the correct function name. Patch from Stephane Letz.
llvm-svn: 37614
2007-06-16 16:17:35 +00:00
Devang Patel
68d03ac6b9 New test.
llvm-svn: 37438
2007-06-05 20:23:20 +00:00
Devang Patel
242d109f63 New test.
llvm-svn: 36416
2007-04-25 00:35:37 +00:00
Reid Spencer
d74463a129 For PR1319: Upgrade to new test harness
llvm-svn: 36070
2007-04-15 10:26:05 +00:00
Owen Anderson
9304434617 Update tests for the disappearance of -idom.
llvm-svn: 36064
2007-04-15 08:54:57 +00:00
Reid Spencer
56b310ae49 Make the llvm-runtest function much more amenable by eliminating all the
global variables that needed to be passed in. This makes it possible to
add new global variables with only a couple changes (Makefile and llvm-dg.exp)
instead of touching every single dg.exp file.

llvm-svn: 35918
2007-04-11 19:56:59 +00:00
Owen Anderson
4b323657b9 Remove DomSet completely. This concludes work on PR1171.
llvm-svn: 35775
2007-04-08 21:30:05 +00:00
Chris Lattner
8fd39019e0 these test a pass that no longer exists.
llvm-svn: 35750
2007-04-07 20:25:30 +00:00
Chris Lattner
cc81108ac2 xfail these until owen can figure out the right fix
llvm-svn: 35748
2007-04-07 20:00:36 +00:00
Devang Patel
cfae673742 Test case for PR1158
llvm-svn: 33914
2007-02-05 19:33:20 +00:00
Reid Spencer
4572ce85b0 Regression is gone, don't try to find it on clean target.
llvm-svn: 33296
2007-01-17 07:59:14 +00:00