Commit Graph

69 Commits

Author SHA1 Message Date
Nick Lewycky
1bb580a3aa Reject unrepresentable pointer types in intrinsics. Fixes PR7316.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110541 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-08 06:12:09 +00:00
Mon P Wang
20adc9dc46 Reapply address space patch after fixing an issue in MemCopyOptimizer.
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100304 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 03:10:48 +00:00
Mon P Wang
e754d3fb85 Revert r100191 since it breaks objc in clang
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100199 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 18:43:02 +00:00
Mon P Wang
e33c848fa4 Reapply address space patch after fixing an issue in MemCopyOptimizer.
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100191 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 18:04:15 +00:00
Bob Wilson
100f090add Revert Mon Ping's change 99928, since it broke all the llvm-gcc buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99948 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 22:27:04 +00:00
Mon P Wang
808bab0169 Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
A update of langref will occur in a subsequent checkin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99928 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 20:55:56 +00:00
Dan Gohman
aceba31b7a Delete useless trailing semicolons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92740 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 17:55:26 +00:00
Dan Gohman
fea1dd0804 Remove obsolete -f flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79992 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 15:38:29 +00:00
Duncan Sands
44008257a4 Dan noticed that the verifier wasn't thoroughly checking uses of
invoke results (see the testcases).  Tighten up the checking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72586 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-29 19:39:36 +00:00
Torok Edwin
382cb2189a Revert this. There's no way to verifiy indirect calls, and an optimizer can turn
indirect call into direct call, thus the verifier would reject something it
previously accepted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72249 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22 07:12:05 +00:00
Torok Edwin
9107c54693 Verify that calling conventions match function prototype.
This only rejects mismatches between target specific calling convention
and C/LLVM specific calling convention.
There are too many fastcc/C, coldcc/cc42 mismatches in the testsuite, these are
not reject by the verifier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72248 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22 06:41:43 +00:00
Chris Lattner
df98617b23 Reimplement the old and horrible bison parser for .ll files with a nice
and clean recursive descent parser.

This change has a couple of ramifications:
1. The parser code is about 400 lines shorter (in what we maintain, not
   including what is autogenerated).
2. The code should be significantly faster than the old code because we 
   don't have to work around bison's poor handling of datatypes with 
   ctors/dtors.  This also makes the code much more resistant to memory 
   leaks.
3. We now get caret diagnostics from the .ll parser, woo.
4. The actual diagnostics emited from the parser are completely different
   so a bunch of testcases had to be updated.
5. I now disallow "%ty = type opaque %ty = type i32".  There was no good
   reason to support this, it was just an accident of the old 
   implementation.  I have no reason to think that anyone is actually using
   this.
6. The syntax for sticking a global variable has changed to make it 
   unambiguous.  I don't think anyone is depending on this since only clang
   supports this and it is not solid yet, so I'm not worried about anything
   breaking.
7. This gets rid of the last use of bison, and along with it the .cvs files.
   I'll prune this from the makefiles as a subsequent commit.

There are a few minor cleanups that can be done after this commit (suggestions
welcome!) but this passes dejagnu testing and is ready for its time in the
limelight.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61558 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 07:01:27 +00:00
Nick Lewycky
70c44f0cce Correct this error message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59370 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 17:50:47 +00:00
Dan Gohman
39dfc2cb9c Diagnose uses of unsized types with the byval attribute in the
verifier. See PR2711 for details.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55414 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-27 14:48:06 +00:00
Chris Lattner
259f88e3c9 Verify that the alignment argument to llvm.memcpy is a constant
integer, PR2318.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55228 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 05:31:10 +00:00
Matthijs Kooijman
1cd8f11cc0 For all RUN lines starting with "not", redirect stderr to /dev/null so tests
don't fail when (expected) error output is produced. This fixes 17 tests.

While I was there, I also made all RUN lines of the form "not llvm-as..." a bit
more consistent, they now all redirect stderr and stdout to /dev/null and use
input redirect to read their input.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52174 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-10 12:57:32 +00:00
Dan Gohman
e4977cf750 Make structs and arrays first-class types, and add assembly
and bitcode support for the extractvalue and insertvalue
instructions and constant expressions.

Note that this does not yet include CodeGen support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51468 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 01:55:30 +00:00
Gabor Greif
5edf210bdf Eliminate questionable syntax for stdin redirection. This probably also speeds things up a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51357 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 22:07:21 +00:00
Gabor Greif
f6cadc440c sabre brings to my attention that the 'tr' suffix is also obsolete
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51349 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 21:00:03 +00:00
Gabor Greif
722243bd40 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51328 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 19:52:04 +00:00
Dan Gohman
eedff319dc Revert the change from r51157 in
test/Verifier/2002-11-05-GetelementptrPointers.ll, which was incorrect.
Instead, fix getIndexedType to not follow pointer types, as
PointerType is a subclass of CompositeType.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51171 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-16 00:16:32 +00:00
Dan Gohman
041e2eb517 IR support for extractvalue and insertvalue instructions. Also, begin
moving toward making structs and arrays first-class types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51157 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-15 19:50:34 +00:00
Anton Korobeynikov
ef30c1d006 Add testcase for prev. commit. Minor fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48686 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-22 08:37:05 +00:00
Nick Lewycky
3f63785cc6 All of these tests had out of date syntax and were never even running through
llvm-upgrade because nobody noticed them failing.

Update to use new syntax and actually check for the right failure by looking at
the error message.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48417 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 07:55:46 +00:00
Nick Lewycky
917a5d9425 Functions are allowed to return structures. (Note that this test never failed.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48416 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 07:49:49 +00:00
Nick Lewycky
2476841553 Regressions/ is long gone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48415 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 07:31:23 +00:00
Tanya Lattner
ceca194c43 Remove llvm-upgrade and update tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48137 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 07:21:50 +00:00
Chris Lattner
ab3b77834c Fix PR2113 by verifying allocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47792 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-01 09:01:57 +00:00
Chris Lattner
ad23d43f18 Fix this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47791 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-01 09:00:21 +00:00
Chris Lattner
3b8ea6e0a8 update this test to pass with duncan's change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46246 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-22 05:31:58 +00:00
Duncan Sands
02e30d70e2 This test is now the same as byval-1.ll, so remove it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45960 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-14 14:57:30 +00:00
Duncan Sands
559ad3c2c2 Test that byval cannot be used with pointers to
types with no size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45959 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-14 14:55:05 +00:00
Duncan Sands
d6a844cda8 We now allow byval on fairly general pointer types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45956 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-14 06:53:45 +00:00
Duncan Sands
cfad1b4f78 Be more liberal in what parameter attributes are
allowed on the vararg arguments of a call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45909 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-12 16:42:01 +00:00
Duncan Sands
623a389f62 Do not allow attributes beyond a function's last
parameter, even if it is a varargs function.  Do
allow attributes on the varargs part of a call,
but not beyond the last argument.  Only allow
selected attributes to be on the varargs part of
a call (currently only 'byval' is allowed).  The
reasoning here is that most attributes, eg inreg,
simply make no sense here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45887 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 22:36:48 +00:00
Duncan Sands
d9d70395d9 Get the verifier to check attributes on calls as well
as on functions.  Make it verify invokes and not just
ordinary calls.  As a (desired) side-effect, it is no
longer legal to have call attributes on arguments that
are being passed to the varargs part of a varargs
function (llvm-as drops them on the floor anyway).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45286 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-21 19:19:01 +00:00
Dan Gohman
83935ac59d Use not instead of ignore when an exit status is expected to always
be non-zero.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44866 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 15:50:23 +00:00
Dan Gohman
ecb85ef713 Change &| to |&.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44345 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27 00:50:57 +00:00
Gordon Henriksen
8c33da5dc4 Fix for PR1633: Verifier doesn't fully verify GC intrinsics
LLVM now enforces the following prototypes for the write barriers:

<ty>* @llvm.gcread(<ty2>*, <ty>**)
void @llvm.gcwrite(<ty>*, <ty2>*, <ty>**)

And for @llvm.gcroot, the first stack slot is verified to be an alloca or a 
bitcast of an alloca.

Fixes test/CodeGen/Generic/GC/lower_gcroot.ll, which violated these.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42051 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-17 20:30:04 +00:00
Reid Spencer
1451afe0e4 Make sure these tests pass for the right reasons (verifier error, rather than
failure to assemble).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40696 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 23:07:36 +00:00
Rafael Espindola
b91025b619 check for correct usage of the byval attribute
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38506 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-10 19:28:12 +00:00
John Criswell
e644ef7b09 Convert .cvsignore files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37801 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 16:35:07 +00:00
Chris Lattner
19292a447c remove bogus xfailed testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36790 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-05 20:49:28 +00:00
Reid Spencer
a9338b6195 For PR1319: Upgrade to new test harness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36070 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-15 10:26:05 +00:00
Reid Spencer
0f5aed5648 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35918 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 19:56:59 +00:00
Reid Spencer
e3ff5ada8a For PR761:
Remove "target endian/pointersize" or add "target datalayout" to make
the test parse properly or set the datalayout because defaults changes.

For PR645:
Make global names use the @ prefix.

For llvm-upgrade changes:
Fix test cases or completely remove use of llvm-upgrade for test cases
that cannot survive the new renaming or upgrade capabilities.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33533 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-26 08:25:06 +00:00
Chris Lattner
adbb6383a9 testcases for PR1042
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32625 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-16 02:26:57 +00:00
Chris Lattner
32c081ae5f New testcase for PR1047
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32528 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 04:30:18 +00:00
Reid Spencer
a5ce97b15a Make sure this file gets upgraded with llvm-upgrade
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32138 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-02 20:42:32 +00:00
Reid Spencer
e5d4efa63e Promote GEP ubyte indices to uint. Backwards compatibility for 1.2 and
older features will be dropped soon and these test cases must not rely
on the upgrade capability.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31896 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-23 15:14:52 +00:00