summaryrefslogtreecommitdiff
path: root/test/Integer
AgeCommit message (Collapse)Author
2016-05-10Make "@name =" mandatory for globals in .ll files.Rafael Espindola
An oddity of the .ll syntax is that the "@var = " in @var = global i32 42 is optional. Writing just global i32 42 is equivalent to @0 = global i32 42 This means that there is a pretty big First set at the top level. The current implementation maintains it manually. I was trying to refactor it, but then started wondering why keep it a all. I personally find the above syntax confusing. It looks like something is missing. This patch removes the feature and simplifies the parser. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269096 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-16[opaque pointer type] Add textual IR support for explicit type parameter to ↵David Blaikie
the call instruction See r230786 and r230794 for similar changes to gep and load respectively. Call is a bit different because it often doesn't have a single explicit type - usually the type is deduced from the arguments, and just the return type is explicit. In those cases there's no need to change the IR. When that's not the case, the IR usually contains the pointer type of the first operand - but since typed pointers are going away, that representation is insufficient so I'm just stripping the "pointerness" of the explicit type away. This does make the IR a bit weird - it /sort of/ reads like the type of the first operand: "call void () %x(" but %x is actually of type "void ()*" and will eventually be just of type "ptr". But this seems not too bad and I don't think it would benefit from repeating the type ("void (), void () * %x(" and then eventually "void (), ptr %x(") as has been done with gep and load. This also has a side benefit: since the explicit type is no longer a pointer, there's no ambiguity between an explicit type and a function that returns a function pointer. Previously this case needed an explicit type (eg: a function returning a void() function was written as "call void () () * @x(" rather than "call void () * @x(" because of the ambiguity between a function returning a pointer to a void() function and a function returning void). No ambiguity means even function pointer return types can just be written alone, without writing the whole function's type. This leaves /only/ the varargs case where the explicit type is required. Given the special type syntax in call instructions, the regex-fu used for migration was a bit more involved in its own unique way (as every one of these is) so here it is. Use it in conjunction with the apply.sh script and associated find/xargs commands I've provided in rr230786 to migrate your out of tree tests. Do let me know if any of this doesn't cover your cases & we can iterate on a more general script/regexes to help others with out of tree tests. About 9 test cases couldn't be automatically migrated - half of those were functions returning function pointers, where I just had to manually delete the function argument types now that we didn't need an explicit function type there. The other half were typedefs of function types used in calls - just had to manually drop the * from those. import fileinput import sys import re pat = re.compile(r'((?:=|:|^|\s)call\s(?:[^@]*?))(\s*$|\s*(?:(?:\[\[[a-zA-Z0-9_]+\]\]|[@%](?:(")?[\\\?@a-zA-Z0-9_.]*?(?(3)"|)|{{.*}}))(?:\(|$)|undef|inttoptr|bitcast|null|asm).*$)') addrspace_end = re.compile(r"addrspace\(\d+\)\s*\*$") func_end = re.compile("(?:void.*|\)\s*)\*$") def conv(match, line): if not match or re.search(addrspace_end, match.group(1)) or not re.search(func_end, match.group(1)): return line return line[:match.start()] + match.group(1)[:match.group(1).rfind('*')].rstrip() + match.group(2) + line[match.end():] for line in sys.stdin: sys.stdout.write(conv(re.search(pat, line), line)) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235145 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-13[opaque pointer type] Add textual IR support for explicit type parameter to ↵David Blaikie
gep operator Similar to gep (r230786) and load (r230794) changes. Similar migration script can be used to update test cases, which successfully migrated all of LLVM and Polly, but about 4 test cases needed manually changes in Clang. (this script will read the contents of stdin and massage it into stdout - wrap it in the 'apply.sh' script shown in previous commits + xargs to apply it over a large set of test cases) import fileinput import sys import re rep = re.compile(r"(getelementptr(?:\s+inbounds)?\s*\()((<\d*\s+x\s+)?([^@]*?)(|\s*addrspace\(\d+\))\s*\*(?(3)>)\s*)(?=$|%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|zeroinitializer|<|\[\[[a-zA-Z]|\{\{)", re.MULTILINE | re.DOTALL) def conv(match): line = match.group(1) line += match.group(4) line += ", " line += match.group(2) return line line = sys.stdin.read() off = 0 for match in re.finditer(rep, line): sys.stdout.write(line[off:match.start()]) sys.stdout.write(conv(match)) off = match.end() sys.stdout.write(line[off:]) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232184 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27[opaque pointer type] Add textual IR support for explicit type parameter to ↵David Blaikie
load instruction Essentially the same as the GEP change in r230786. A similar migration script can be used to update test cases, though a few more test case improvements/changes were required this time around: (r229269-r229278) import fileinput import sys import re pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)") for line in sys.stdin: sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line)) Reviewers: rafael, dexonsmith, grosser Differential Revision: http://reviews.llvm.org/D7649 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230794 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27[opaque pointer type] Add textual IR support for explicit type parameter to ↵David Blaikie
getelementptr instruction One of several parallel first steps to remove the target type of pointers, replacing them with a single opaque pointer type. This adds an explicit type parameter to the gep instruction so that when the first parameter becomes an opaque pointer type, the type to gep through is still available to the instructions. * This doesn't modify gep operators, only instructions (operators will be handled separately) * Textual IR changes only. Bitcode (including upgrade) and changing the in-memory representation will be in separate changes. * geps of vectors are transformed as: getelementptr <4 x float*> %x, ... ->getelementptr float, <4 x float*> %x, ... Then, once the opaque pointer type is introduced, this will ultimately look like: getelementptr float, <4 x ptr> %x with the unambiguous interpretation that it is a vector of pointers to float. * address spaces remain on the pointer, not the type: getelementptr float addrspace(1)* %x ->getelementptr float, float addrspace(1)* %x Then, eventually: getelementptr float, ptr addrspace(1) %x Importantly, the massive amount of test case churn has been automated by same crappy python code. I had to manually update a few test cases that wouldn't fit the script's model (r228970,r229196,r229197,r229198). The python script just massages stdin and writes the result to stdout, I then wrapped that in a shell script to handle replacing files, then using the usual find+xargs to migrate all the files. update.py: import fileinput import sys import re ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))") normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))") def conv(match, line): if not match: return line line = match.groups()[0] if len(match.groups()[5]) == 0: line += match.groups()[2] line += match.groups()[3] line += ", " line += match.groups()[1] line += "\n" return line for line in sys.stdin: if line.find("getelementptr ") == line.find("getelementptr inbounds"): if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("): line = conv(re.match(ibrep, line), line) elif line.find("getelementptr ") != line.find("getelementptr ("): line = conv(re.match(normrep, line), line) sys.stdout.write(line) apply.sh: for name in "$@" do python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name" rm -f "$name.tmp" done The actual commands: From llvm/src: find test/ -name *.ll | xargs ./apply.sh From llvm/src/tools/clang: find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}" From llvm/src/tools/polly: find test/ -name *.ll | xargs ./apply.sh After that, check-all (with llvm, clang, clang-tools-extra, lld, compiler-rt, and polly all checked out). The extra 'rm' in the apply.sh script is due to a few files in clang's test suite using interesting unicode stuff that my python script was throwing exceptions on. None of those files needed to be migrated, so it seemed sufficient to ignore those cases. Reviewers: rafael, dexonsmith, grosser Differential Revision: http://reviews.llvm.org/D7636 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230786 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-16[tests] Cleanup initialization of test suffixes.Daniel Dunbar
- 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-04-08Rewrite test/Integer tests to use FileCheck instead of grepEli Bendersky
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179047 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-27Remove the dependent libraries feature.Bill Wendling
The dependent libraries feature was never used and has bit-rotted. Remove it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168694 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02Convert all tests using TCL-style quoting to use shell-style quoting.Chandler Carruth
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-05-27remove two (useless) tests that use incorrect intrinsic prototypes, detected ↵Chris Lattner
by the new intrinsic verifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157543 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16Replace all instances of dg.exp file with lit.local.cfg, since all tests are ↵Eli Bendersky
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
2011-06-19Remove support for parsing the "type i32" syntax for defining a numberedChris Lattner
top level type without a specified number. This syntax isn't documented and blocks forward progress. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133371 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-17Stop accepting and ignoring attributes in function types. Attributes are ↵Chris Lattner
applied to functions and call/invokes, not to types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133266 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-17make the asmparser reject function and type redefinitions. 'Merging' hasn't ↵Chris Lattner
been needed since llvm-gcc 3.4 days. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133248 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-17stop accepting begin/end around function bodies in the .ll parser, this ↵Chris Lattner
isn't pascal anymore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133244 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-17manually upgrade a bunch of tests to modern syntax, and remove some thatChris Lattner
are either unreduced or only test old syntax. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133228 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02we are past the point where these tests are useful.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112887 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05Delete useless trailing semicolons.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92740 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-05Eliminate some Tclisms.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81081 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12Now that numbered types have their number printed, it's no longerDan Gohman
interesting to print the number in a comment. Numbered instructions don't need their number in a comment either. Also, tidy up newline printing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78865 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12Make LLVM Assembly dramatically easier to read by aligning the comments,Dan Gohman
using formatted_raw_ostream's PadToColumn. Before: bb1: ; preds = %bb %2 = sext i32 %i.01 to i64 ; <i64> [#uses=1] %3 = getelementptr double* %p, i64 %2 ; <double*> [#uses=1] %4 = load double* %3, align 8 ; <double> [#uses=1] %5 = fmul double %4, 1.100000e+00 ; <double> [#uses=1] %6 = sext i32 %i.01 to i64 ; <i64> [#uses=1] %7 = getelementptr double* %p, i64 %6 ; <double*> [#uses=1] After: bb1: ; preds = %bb %2 = sext i32 %i.01 to i64 ; <i64> [#uses=1] %3 = getelementptr double* %p, i64 %2 ; <double*> [#uses=1] %4 = load double* %3, align 8 ; <double> [#uses=1] %5 = fmul double %4, 1.100000e+00 ; <double> [#uses=1] %6 = sext i32 %i.01 to i64 ; <i64> [#uses=1] %7 = getelementptr double* %p, i64 %6 ; <double*> [#uses=1] Several tests required whitespace adjustments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78816 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-24Converted a1.ll to unittests.Misha Brukman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67652 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05alignment of 0 is not valid.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61682 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02Reimplement the old and horrible bison parser for .ll files with a niceChris Lattner
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
2008-06-10Fix some escaping and quoting in RUN lines, mainly involving { and <. In twoMatthijs Kooijman
cases quoting of <{ didn't work out, so I changed the grep to check for }> instead. This fixes 7 testcases that were not properly running before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52182 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20sabre brings to my attention that the 'tr' suffix is also obsoleteGabor Greif
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51349 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20Rename the last test with .llx extension to .ll, resolve duplicate test by ↵Gabor Greif
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-04-19refactor handling of symbolic constant folding, picking upChris Lattner
a few new cases( see Integer/a1.ll), but not anything that would happen in practice. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49965 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27Fix PR1146: parameter attributes are longer part ofDuncan Sands
the function type, instead they belong to functions and function calls. This is an updated and slightly corrected version of Reid Spencer's original patch. The only known problem is that auto-upgrading of bitcode files doesn't seem to work properly (see test/Bitcode/AutoUpgradeIntrinsics.ll). Hopefully a bitcode guru (who might that be? :) ) will fix it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44359 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-05Change all floating constants that are not exactlyDale Johannesen
representable to use hex format. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41722 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19For PR1553:Reid Spencer
Change the keywords for the zext and sext parameter attributes to be zeroext and signext so they don't conflict with the keywords for the instructions of the same name. This gets around the ambiguity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40069 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29Convert .cvsignore filesJohn Criswell
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37801 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14Changes to fix problems with "make check". Apparently you can redefineReid Spencer
functions and Tcl's just tickled with that. The fix is to give the "new" test system a different interface function name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36022 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14Fix syntax.Reid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36021 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14Don't try to interpret a fictitious file.Reid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36000 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14No need to quote things, shell isn't interpreting any more.Reid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35997 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14For PR1319:Reid Spencer
Changes necessary to run this with the "llvm.exp" version of llvm_runtest. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35995 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14FIx this test, thanks to llvm.expReid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35992 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11Make the llvm-runtest function much more amenable by eliminating all theReid Spencer
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-03-28Remove use of implementation keyword.Reid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35412 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-28implementation keyword is going .. going .. gone.Reid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35404 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-24Flip the srem tests around. Previous commit was to correct an apparentReid Spencer
bug in the srem implementation. Turns out it was a documentation bug instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35304 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-24Fix incorrect test cases for srem. The definition of srem is a remainder soReid Spencer
that the sign of the result follows the sign of the divisor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35301 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-19For PR1258:Reid Spencer
Revise numeric value references to accommodate collapsed type planes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35170 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27Update for constant folding now generating undef and overflow correctly.Reid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34676 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27Shifting by the bit width now produces undef, not 0.Reid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34675 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27Remove test cases that produce undefined results.Reid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34650 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05For PR411:Reid Spencer
This test is not particularly useful without type planes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33919 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05For PR411:Reid Spencer
This patch replaces the SymbolTable class with ValueSymbolTable which does not support types planes. This means that all symbol names in LLVM must now be unique. The patch addresses the necessary changes to deal with this and removes code no longer needed as a result. This completes the bulk of the changes for this PR. Some cleanup patches will follow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33918 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-04Prepare for PR411Reid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33865 91177308-0d34-0410-b5e6-96231b3b80d8