summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/cpp11-migrate
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't include outer-most explicit cast in nullptr replacementEdwin Vane2013-03-151-7/+48
| | | | | | | | | | The outer-most explicit cast is now left alone by the Use-Nullptr transform to maintain the type of the expression and avoid introducing ambiguities. Fixes PR15395. Author: Ariel J Bernal <ariel.j.bernal@intel.com> llvm-svn: 177179
* Prevent nullptr_t-typed exprs from being replacedEdwin Vane2013-03-151-7/+19
| | | | | | | | | | The Use-Nullptr transform was replacing nullptr_t-typed expressions because in the AST such expressions have an implicit NullToPointer cast around them. Now the transform ignores these expressions. Fixes PR15414. llvm-svn: 177168
* Turned no_xform into a pass from expected failure.Edwin Vane2013-03-081-2/+1
| | | | | | | Since no_xform is not a bug to be fixed, made the test pass using the 'not' utility and removed XFAIL. llvm-svn: 176709
* Extend loop variable naming checksEdwin Vane2013-03-0810-155/+258
| | | | | | | | | | | | The loop convert tests for conflicting names have been extended to check for macro names, types, and language keywords including language extensions. Tests have also been added. Fixes PR15322 Author: Jack Yang <jack.yang@intel.com> Reviewer: gribozavr, klimek, revane llvm-svn: 176690
* Have LoopConvert use 'auto &&' where necessaryEdwin Vane2013-03-073-15/+55
| | | | | | | | | | | | | | | | For iterators where the dereference operator returns by value, LoopConvert should use 'auto &&' in the range-based for loop expression. If the dereference operator returns an rvalue reference, this is deemed too strange and the for loop is not converted. Moved test case from iterator_failing.cpp to iterator.cpp and added extra tests. Fixes PR15437. Reviewer: gribozavr llvm-svn: 176631
* Switch from autogenerating tests to using the preprocessor.Chandler Carruth2013-03-078-445/+255
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOTE: You may need to run 'make clean' or 'ninja -t clean' etc!!! This is due to really nasty bug/interactions between CMake/configure/make/Ninja/LIT... This commit tries to back out the support for generating test cases as part of the build system due to the issues I brought up in post-commit review: 1) It adds a *lot* of complexity and fragility to the build system. See the number of commits required to try to get all the bots happy. 2) It isn't really necessary -- we can already run scripts to generate things with the RUN lines of a test. 3) It makes the tests somewhat harder to debug as they cross between more domains. 4) In almost all cases it isn't really needed or it can be done directly using the preprocessor. I should have been more proactive reviewing this, and I'm really sorry about the churn here. =/ To help keep track of what commits are going where, this backs out most of the non-test-changes from these revisions: r176397 r176373 r176293 r176184 r175744 r175624 r175545 r175544 There were several trivial or cleanup changes to the lit files or other files. Some of these looked ok, but I didn't try to tease them apart... Edwin, if you know what to look for, please carry on with the cleanups there, and sorry for hosing stuff here but I'm not much of a Python person, and so I was erring on the side of cautiously backing out the change. I've tried to preserve the test changes everywhere I could, but review is appreciated here in case I missed some. I then re-wrote the tests to use the preprocessor rather than python to expand to the various bits of code. The nicest part of this is that now all the files are just C++ code. They edit and behave like C++ code, etc. RUN lines with different -D flags are used to run the same test over multiple different configurations, and includes bracketed in special defines are used to flesh out a collection of standard interface stubs to test interactions between pieces. These probably aren't perfect yet, but I think its an improvement (at least in terms of build system complexity) and will hopefully be a useful demonstration of the technique I prefer for these types of tests. llvm-svn: 176627
* Test case for PR-15414 - nullptr_t functionsStefanus Du Toit2013-03-061-0/+17
| | | | | | | | | | | | | The use-null-ptr transform will transform calls to functions that return a nullptr_t. Even if the function were to only return a null pointer and do nothing else, this replacement would still be undesired as the behavior and signature of the function could change in the future. This adds an XFAILed test case to demonstrate the issue. Reviewed by: Edwin Vane, Tareq Siraj llvm-svn: 176553
* Fixed Use-Nullptr when replacing return(0)Edwin Vane2013-03-061-0/+31
| | | | | | | | | | | | Before fix, the paren expression was being replaced resulting in returnnullptr. ParenExpr and implicit casts now ignored so we get return(nullptr) instead. Added new test cases. Fixes PR15398 Author: Ariel Bernal <ariel.j.bernal@intel.com> llvm-svn: 176551
* Adding failing LoopConvert testcaseEdwin Vane2013-03-042-0/+27
| | | | | | | | | LoopConvert isn't properly handling iterators whose dereference operator returns by value. This test case demonstrates the failure. See PR15437. llvm-svn: 176437
* Properly identify 'this' as range-based for containerEdwin Vane2013-03-041-1/+71
| | | | | | | | | The Loop-Convert transform was mistransforming loops using 'this' implicitly. Fixed and added tests. Fixes PR15411. llvm-svn: 176436
* Make gen_my_std.h.py compatible with python 2.5 too.Benjamin Kramer2013-03-021-23/+23
| | | | llvm-svn: 176409
* Make the UseAuto test case generator compatible with python 2.5.Benjamin Kramer2013-03-021-16/+16
| | | | llvm-svn: 176406
* Avoid parallelism problems generating lit.site.cfgsEdwin Vane2013-03-011-13/+14
| | | | | | | | extra/test/cpp11-migrate/Makefile was using the same tmp file for generating lit.site.cfg for two different directories. Parallelism caused conflicts so now using differently named temp files. llvm-svn: 176379
* Fix recursive make in clang-tools-extraEdwin Vane2013-03-012-3/+2
| | | | | | | | | | | | | | Autoconf make (all) now properly recurses from tools/extra/Makefile into tools/extra/test/Makefile and tools/extra/test/cpp11-migrate/Makefile. The 'all' target is responsible for creating lit config files and autogenerating tests. Subsequent 'check-all' targets will properly work. Re-enabling UseAuto/iterator.cpp test. General clean-up of clang-tools-extra makefiles; removing dead targets and removing duplicated pieces of llvm/Makefile.rules. llvm-svn: 176373
* Don't use 'exit' in lit scriptEdwin Vane2013-02-281-4/+1
| | | | | | | | Some buildbots use a shell that doesn't know 'exit'. So instead of using XFAIL for UseAuto/iterator.cpp (since this problem doesn't exist for cmake) leave the 'grep' command and turn off the others. llvm-svn: 176295
* Turning off UseAuto/iterator.cpp test until recursive make issue fixedEdwin Vane2013-02-281-3/+6
| | | | | | | | | The way 'make check-all' causes configuration files to be generated results in the cpp11-migrate/Makefile not being triggered to generated any files. These files are necessary for UseAuto/iterator.cpp to run. Turning off this test until the problem is fixed properly. llvm-svn: 176293
* Introducing Use-Auto transform for cpp11-migrateEdwin Vane2013-02-283-44/+286
| | | | | | | | | | | The new Use-Auto transform replaces the type specifier for variable declarations with the special C++11 'auto' type specifier. For now, the replacement is done only for variables that are iterators of any of the std containers and only if the type used is one of those explicitly allowed by the standard (i.e. not an implementation-specific type). Reviewers: gribozavr, silvas, klimek llvm-svn: 176266
* Custom lit.site.cfg configuration for cpp11-migrateEdwin Vane2013-02-273-12/+73
| | | | | | | | | | | To afford hand-written tests access to any auto-generated headers, a lit.site.cfg is now created for cpp11-migrate's test directory providing a new config.substition. Tests can refer to %gen_root in the LIT script. Removed use of --param clang_site_config. Not necessary when running tests using the build system. llvm-svn: 176184
* Fixing a "multiple rules generate X" warning from ninjaEdwin Vane2013-02-211-1/+2
| | | | | | | | | | CMake's Ninja generator was not detecting that test/lit.site.cfg.in and test/subdir/../lit.site.cfg.in were really the same file. Ninja noticed this and complained as both appeared as targets (for the missing file rule). Now canonicalizing the path to ensure the paths presented to CMake are identical and the duplication is now fixed. llvm-svn: 175744
* Tweaks and fixes to cpp11-migrate generated testsEdwin Vane2013-02-202-14/+14
| | | | | | | | | * Fixed a comment typo * Changed 'autogen' to 'generated-tests' * Made the clean target not fail if the 'generated-tests' directory doesn't already exist. llvm-svn: 175624
* Adding files left out of commit r175544.Edwin Vane2013-02-194-0/+278
| | | | llvm-svn: 175545
* Fix -use-nullptr problems with assert()Edwin Vane2013-02-171-0/+26
| | | | | | | | | | | | | If a cast expression (NullToPointer) is detected in a function-like macro parameter, we should use the spelling location instead of the expansion location. Using SourceManager::getFileLoc() fixes this problem. Also added testcases for this bug. Fixes: PR15279 Author: Tareq A Siraj <tareq.a.siraj@intel.com> Reviewer: klimek llvm-svn: 175399
* Fix for combined loop and nullptr convert testsEdwin Vane2013-02-071-1/+0
| | | | | | | | | | | | The rewriter was previously reading the content buffer from the file itself. Since we are now keeping the content in memory and writing to the file only once, the rewriter's buffer (from the file) was not in sync with the RefactoringTool's buffer. Adding an overrideFileContents call (similar to how Clang-format handles for this) will resolve this issue. Author: Jack Yang <jack.yang@intel.com> Reviewers: gribozavr, klimek llvm-svn: 174643
* Drop "REQUIRES:shell" in tests. They can run on win32.NAKAMURA Takumi2013-01-254-4/+0
| | | | llvm-svn: 173415
* Add use-nullptr transform to cpp11-migrateEdwin Vane2013-01-224-0/+258
| | | | | | | | | | | | | | | | | | | This transform converts the usage of null pointer constants (e.g. NULL, 0, etc.) in legacy C++ code and converts them to use the new C++11 nullptr keyword. - Added use-nullptr transform. - Added C++11 support to the final syntax check. Used ArgumentAdjuster class to add -std=c++11 option to the command line options. - Added tests for use-nullptr transform. - Added tests that exercises both loop-convert and use-nullptr in the source file. TODO: There's a known bug when using both -loop-convert and -use-nullptr at the same time. Author: Tareq A Siraj <tareq.a.siraj@intel.com> Reviewers: klimek, gribozavr llvm-svn: 173178
* Transferred loop-convert tests to cpp11-migrateEdwin Vane2013-01-0816-0/+1304
| | | | | | | | | | | - Turned off -count-only tests as they aren't supported in cpp11-migrate yet. - Updated tests to use new binary name and options to access loop-convert transform. - Fixed header guards to not use restricted names. Reviewers: klimek, gribozavr llvm-svn: 171852
* Port loop-convert into cpp11-migrateEdwin Vane2013-01-042-8/+1
| | | | | | | | | | | | | | Took existing code from loop-convert tool and made it into a cpp11-migrate transform. Pattern now set for having transform code in subdirectories. Related changes: - Makefile and CMakeLists.txt updated to support source files in subdirectories. - At least one transform must be specified. syntax-only tests removed to reflect this. - TODO: port over loop-convert tests. Reviewers: klimek, silvas llvm-svn: 171481
* Initial commit for cpp11-migrate toolEdwin Vane2012-12-122-0/+15
- Added directory structures and build system files for the new tool. - Extremely basic implementation of tool performs only an initial syntax check. - Basic tests ensure syntax test works as expected. llvm-svn: 169983
OpenPOWER on IntegriCloud