summaryrefslogtreecommitdiff
path: root/test/Frontend
Commit message (Collapse)AuthorAgeFilesLines
* Don't generate assembly in backend diagnostic testsAlp Toker2014-06-062-3/+3
| | | | | | | | | | | A leftover -S was generating unwanted output in the source tree overriding -only flags that normally disable output. This reverts commit r210323 and implements the proper fix. Reported by Timur Iskhodzhanov! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210326 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -o /dev/null to one of the tests as it fails when run from a read-only ↵Timur Iskhodzhanov2014-06-061-2/+2
| | | | | | checkout git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210323 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide fallback locations for backend remarksAlp Toker2014-06-052-20/+19
| | | | | | | | | | | | Instead of disembodied diagnostics when debug info is disabled it's now possible to identify the associated function's location in order to provide some amount of of context. We use the definition's body right brace location to differentiate the fallback from diagnostics that genuinely relate to the function declaration itself (a convention also used by gcc). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210294 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement -Wframe-larger-than backend diagnosticAlp Toker2014-06-051-6/+3
| | | | | | | | | | | | | | | | | | Add driver and frontend support for the GCC -Wframe-larger-than=bytes warning. This is the first GCC-compatible backend diagnostic built around LLVM's reporting feature. This commit adds infrastructure to perform reverse lookup from mangled names emitted after LLVM IR generation. We use that to resolve precise locations and originating AST functions, lambdas or block declarations to produce seamless codegen-guided diagnostics. An associated change, StringMap now maintains unique mangled name strings instead of allocating copies. This is a net memory saving in C++ and a small hit for C where we no longer reuse IdentifierInfo storage, pending further optimisation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210293 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix leak from r210059Alp Toker2014-06-031-3/+2
| | | | | | | Also revert r210096 which temporarily disabled the test while this was being investigated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210115 91177308-0d34-0410-b5e6-96231b3b80d8
* temporary disable part of a test because it causes clang to leak memory ↵Kostya Serebryany2014-06-031-2/+3
| | | | | | (want to have the sanitizer bot green) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210096 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix -emit-codegen-only to not generate binariesAlp Toker2014-06-031-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210059 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary test.Diego Novillo2014-05-301-28/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209893 91177308-0d34-0410-b5e6-96231b3b80d8
* clang/test/Frontend/Weverything-and-remarks.cpp: Add explicit -target.NAKAMURA Takumi2014-05-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | You could see unexpected result (*.tmp.err) with "-target x86_64-win32". Weverything-and-remarks.cpp:11:9: warning: 'char32_t' type specifier is incompatible with C++98 [-Wc++98-compat] typedef __char32_t char32_t; ^ Weverything-and-remarks.cpp:12:27: error: typedef redefinition with different types ('unsigned long' vs 'unsigned long long') typedef long unsigned int size_t; ^ Weverything-and-remarks.cpp:19:62: warning: dynamic exception specifications are deprecated [-Wdeprecated] static void assign(char_type& __c1, const char_type& __c2) throw() { ^~~~~~~ Weverything-and-remarks.cpp:19:62: note: use 'noexcept' instead static void assign(char_type& __c1, const char_type& __c2) throw() { ^~~~~~~ noexcept Weverything-and-remarks.cpp:25:46: warning: unused parameter '__n' [-Wunused-parameter] size_t __n) { ^ 3 warnings and 1 error generated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209878 91177308-0d34-0410-b5e6-96231b3b80d8
* Add flags -Rpass-missed and -Rpass-analysis.Diego Novillo2014-05-291-6/+17
| | | | | | | | | | | | | | | | | | | | | | Summary: These two flags are in the same family as -Rpass, but are used in different situations. -Rpass-missed is used by optimizers to inform the user when they tried to apply an optimization but couldn't (or wouldn't). -Rpass-analysis is used by optimizers to report analysis results back to the user (e.g., why the transformation could not be applied). Depends on D3682. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3683 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209839 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing -S to avoid invoking assembler unnecessarily.Diego Novillo2014-05-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209828 91177308-0d34-0410-b5e6-96231b3b80d8
* No longer allow the -std options to entirely override the -x language ↵Aaron Ballman2014-05-291-0/+9
| | | | | | option. This allows -x cuda -std=c++11, for instance. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209824 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix spurious remarks when -Weverything is used.Diego Novillo2014-05-291-0/+28
| | | | | | | | | | | With -Weverything, the backend remarks are enabled. This was causing spurious diagnostics for remarks that we don't yet handle (cf http://reviews.llvm.org/D3683). This will stop being a problem once http://reviews.llvm.org/D3683 is committed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209823 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix segmentation fault when mixing -Rpass with #line.Diego Novillo2014-05-081-0/+15
| | | | | | | | | | | | | | | | | | | Summary: When using #line directives, FileManager::getFile() will return a nil entry. This triggers an assert in translateFileLineCol(). This patch handles nil FileEntry instances by emitting a note that the location could not be translated back to a SourceLocation. I don't really like this solution, but we are translating presumed locations, so some information has already been lost. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3625 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208315 91177308-0d34-0410-b5e6-96231b3b80d8
* -fsyntax-only for a testLubos Lunak2014-05-011-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207814 91177308-0d34-0410-b5e6-96231b3b80d8
* Use %clang_cc1 in rewrite-includes-messages.c test and drop REQUIRES: shellReid Kleckner2014-05-011-4/+3
| | | | | | This test passes on Windows with lit's shell interpreter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207810 91177308-0d34-0410-b5e6-96231b3b80d8
* do not hide clang stderr output during a testLubos Lunak2014-05-011-2/+2
| | | | | | | | I don't know why this fails on the buildbot. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207808 91177308-0d34-0410-b5e6-96231b3b80d8
* use 'diff' rather than 'cmp -s' in a testLubos Lunak2014-05-011-1/+1
| | | | | | | | That's what all tests use, no idea where I got the latter from. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207797 91177308-0d34-0410-b5e6-96231b3b80d8
* write a line marker right before adding included fileLubos Lunak2014-05-015-0/+25
| | | | | | | | | | Enclosing the original #include directive inside #if 0 adds lines, so warning/errors messages would have the line number off in "In file included from <file>:<line>:", so add line marker to fix this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207795 91177308-0d34-0410-b5e6-96231b3b80d8
* do not use "1" for line marker for the predefines "file" eitherLubos Lunak2014-05-011-0/+9
| | | | | | | | Similar to r207764. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207794 91177308-0d34-0410-b5e6-96231b3b80d8
* Support 'remark' in VerifyDiagnosticConsumerTobias Grosser2014-05-011-4/+3
| | | | | | | After Diego added support for -Rpass=inliner we have now in-tree remarks which we can use to properly test this feature. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207765 91177308-0d34-0410-b5e6-96231b3b80d8
* do not use "1" for line marker for the main fileLubos Lunak2014-05-011-0/+1
| | | | | | | | | | | | "1" means entering a new file (from a different one), but the main file is not included from anything (and this would e.g. confuse -Wunused-macros to not report unused macros in the main file, see pr15610, or also see pr18948). The line marker is still useful e.g. if the resulting file is renamed or used via a pipe. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207764 91177308-0d34-0410-b5e6-96231b3b80d8
* revert r207756Lubos Lunak2014-05-015-25/+0
| | | | | | | | | | There's nothing wrong with the change itself, but test/Frontend/rewrite-includes-messages.c fails without another not-yet-committed fix. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207762 91177308-0d34-0410-b5e6-96231b3b80d8
* write a line marker right before adding included fileLubos Lunak2014-05-015-0/+25
| | | | | | | | | | Enclosing the original #include directive inside #if 0 adds lines, so warning/errors messages would have the line number off in "In file included from <file>:<line>:", so add line marker to fix this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207756 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify test. No functional change intended.Andrea Di Biagio2014-04-301-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207623 91177308-0d34-0410-b5e6-96231b3b80d8
* Add test case for revision 207575 to verify that on Windows, clang doesn'tAndrea Di Biagio2014-04-291-0/+8
| | | | | | | | | | | crash with an assertion failure when 'nul' is passed in input. Modified clang/test/lit.py to add feature 'system-windows' if `platform.system()` returns 'Windows'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207576 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow adding a value to a flag in diagnostics.Diego Novillo2014-04-211-1/+1
| | | | | | | | | | | | | | | | | Summary: This allows callers of Diags.Report() to append a value to the name of the flag associated with the diagnostic. This is useful in cases like the -Rpass flag, where we want the diagnostic to show the name of the pass that matched the pattern. Instead of showing "... [-Rpass]", this allows us to show "... [-Rpass=passname]". Reviewers: rsmith CC: cfe-commits Differential Revision: http://reviews.llvm.org/D3441 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206826 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix check failure on hexagon targets.Diego Novillo2014-04-161-2/+2
| | | | | | | | | | | This test was failing because there is no assembler for hexagon-elf on this buildbot: http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/10470 Fixed by adding -S to the driver invocation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206412 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for optimization reports.Diego Novillo2014-04-161-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds a new flag -Rpass=. The flag indicates the name of the optimization pass that should emit remarks stating when it made a transformation to the code. This implements the design I proposed in: https://docs.google.com/document/d/1FYUatSjZZO-zmFBxjOiuOzAy9mhHA8hqdvklZv68WuQ/edit?usp=sharing Other changes: - Add DiagnosticIDs::isRemark(). Use it in printDiagnosticOptions to print "-R" instead of "-W" in the diagnostic message. - In BackendConsumer::OptimizationRemarkHandler, get a SourceLocation object out of the file name, line and column number. Use that location in the call to Diags.Report(). - When -Rpass is used without debug info a note is emitted alerting the user that they need to use -gline-tables-only -gcolumn-info to get this information. CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3226 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206401 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the -i[no-]system-prefix options from CC1Options.td to Options.td.Alexander Kornienko2014-03-261-1/+2
| | | | | | | | | | | | | | | | Summary: This allows them to be used without -cc1 the same way as -I and -isystem. Renamed the options to --system-header-prefix=/--no-system-header-prefix to avoid interference with -isystem and make the intent of the option cleaner. Reviewers: rsmith Reviewed By: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3185 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204775 91177308-0d34-0410-b5e6-96231b3b80d8
* Accept -no-integrated-as in -cc1 and forward it to llvm.Rafael Espindola2014-02-211-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201837 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-commit: Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove ↵Daniel Sanders2014-02-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hasRawTextSupport() call Summary: AsmPrinter::EmitInlineAsm() will no longer use the EmitRawText() call for targets with mature MC support. Such targets will always parse the inline assembly (even when emitting assembly). Targets without mature MC support continue to use EmitRawText() for assembly output. The hasRawTextSupport() check in AsmPrinter::EmitInlineAsm() has been replaced with MCAsmInfo::UseIntegratedAs which when true, causes the integrated assembler to parse inline assembly (even when emitting assembly output). UseIntegratedAs is set to true for targets that consider any failure to parse valid assembly to be a bug. Target specific subclasses generally enable the integrated assembler in their constructor. The default value can be overridden with -no-integrated-as. All tests that rely on inline assembly supporting invalid assembly (for example, those that use mnemonics such as 'foo' or 'hello world') have been updated to disable the integrated assembler. Changes since review (and last commit attempt): - Fixed test failures that were missed due to configuration of local build. (fixes crash.ll and a couple others). - Fixed tests that happened to pass because the local build was on X86 (should fix 2007-12-17-InvokeAsm.ll) - mature-mc-support.ll's should no longer require all targets to be compiled. (should fix ARM and PPC buildbots) - Object output (-filetype=obj and similar) now forces the integrated assembler to be enabled regardless of default setting or -no-integrated-as. (should fix SystemZ buildbots) Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2686 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201333 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r201237+r201238: Demote EmitRawText call in ↵Daniel Sanders2014-02-121-4/+4
| | | | | | | | | AsmPrinter::EmitInlineAsm() and remove hasRawTextSupport() call It introduced multiple test failures in the buildbots. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201241 91177308-0d34-0410-b5e6-96231b3b80d8
* Arcanist failed to commit the two clang test corrections that should have ↵Daniel Sanders2014-02-121-4/+4
| | | | | | been in r201237. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201238 91177308-0d34-0410-b5e6-96231b3b80d8
* Wired-up the new LLVM diagnostic system into clang diagnostic system.Quentin Colombet2014-02-061-0/+34
| | | | | | | | | | The approach is similar to the existing inline-asm reporting, just more general. <rdar://problem/15886278> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200931 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix r195149. Triple should correctly reflect that target. If it contains ios,Evan Cheng2014-01-261-1/+1
| | | | | | | | | | e.g. thumbv7m-apple-ios3.0.0-eabi, then it should mean it's an iOS target. For embedded targets, the OS should be unknown, e.g. thumbv7m-apple-unknown-macho. Since Tim has recently fixed the triple, r195149 is no longer needed. rdar://15911035 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200164 91177308-0d34-0410-b5e6-96231b3b80d8
* Add tests for clang pluginsAlp Toker2014-01-081-0/+5
| | | | | | | | | | | | | | | Somehow the entire plugin infrastructure went wholly untested until now. The only plugins available for use in testing are the examples, so plugin tests will only be run if CLANG_BUILD_EXAMPLES is enabled in the build. (The examples should really be enabled by default, not just to aid testing but also to prevent bitrot in some key user-facing code. I'll propose that shortly.) Requires supporting changes in LLVM r198746. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198747 91177308-0d34-0410-b5e6-96231b3b80d8
* Override the datalayout in a module with -triple.Rafael Espindola2013-12-201-1/+7
| | | | | | | | | This matches llc's behavior. Before this patch clang would create a TargetInfo base on -triple but a llvm CodeGen based on the triple in the module. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197837 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix raw lex crash and -frewrite-includes noeol-at-eof failureAlp Toker2013-12-131-0/+4
| | | | | | Raw lexers don't have a preprocessor so we need to null check. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197245 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to fix the test for Windows paths after r196859Dmitri Gribenko2013-12-101-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196862 91177308-0d34-0410-b5e6-96231b3b80d8
* clang/test: REQUIRES: s/x86-64-registered-target/x86-registered-target/NAKAMURA Takumi2013-12-041-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196350 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix test on WindowsAlp Toker2013-11-281-2/+2
| | | | | | | | | | | | | 'not' on Windows tries and fails to convert the argument to UTF-16 and back for some reason: Error: Unable to convert command-line to UTF-16 Let's try replacing it with !. (There was no obvious way to do these with FileCheck) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195907 91177308-0d34-0410-b5e6-96231b3b80d8
* Ensure that the output BOM test check is runAlp Toker2013-11-281-1/+3
| | | | | | The first command's output was only reaching one of the two checks previously. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195904 91177308-0d34-0410-b5e6-96231b3b80d8
* One last portability fix attempt for r195886Alp Toker2013-11-271-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195891 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt to make test from r195886 portable with different shellsAlp Toker2013-11-271-2/+2
| | | | | | | Windows and Hexagon complained. It's not clear which command is failing, so will back out the changes if this doesn't do the trick. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195889 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve BOM test from r195877Alp Toker2013-11-271-1/+2
| | | | | | | | 1) Use %clang_cc1 instead of the driver 2) Validate that the input contains a BOM 3) Validate that the BOM has been stripped from the output git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195886 91177308-0d34-0410-b5e6-96231b3b80d8
* strip UTF-8 BOM in -frewrite-includes (PR#15664)Lubos Lunak2013-11-272-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195877 91177308-0d34-0410-b5e6-96231b3b80d8
* ARM: embedded v7 'darwin' doesn't get min-version defines.Jim Grosbach2013-11-191-3/+4
| | | | | | | | | Make sure armv7 doesn't get the iOS deployment version definitions when it's being used for non-iOS. rdar://15497681 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195149 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove period at end of "optimization level is unsupported" diagnosticHans Wennborg2013-11-181-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195048 91177308-0d34-0410-b5e6-96231b3b80d8
* Make test/Driver/clang_f_opts.c not write to the test dirHans Wennborg2013-11-181-1/+1
| | | | | | | After r195009, the test would write a .o file to the test dir. Send that to /dev/null instead. Also fix the typo in test/Frontend/invalid-o-level.c. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195047 91177308-0d34-0410-b5e6-96231b3b80d8