summaryrefslogtreecommitdiffstats
path: root/clang/test/Frontend
Commit message (Collapse)AuthorAgeFilesLines
* Revert "clang/test/Driver/crash-report.c: This requires rewriter for ↵Alp Toker2014-07-1622-3/+1
| | | | | | | | | | | | | | | | | | | | | -frewrite-includes. [PR20321]" We've decided to make the core rewriter class and PP rewriters mandatory. They're only a few hundred lines of code in total and not worth supporting as a distinct build configuration, especially since doing so disables key compiler features. This reverts commit r213150. Revert "clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter." This reverts commit r213148. Revert "Move clang/test/Frontend/rewrite-*.c to clang/test/Frontend/Rewriter/" This reverts commit r213146. llvm-svn: 213159
* clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter.NAKAMURA Takumi2014-07-161-0/+2
| | | | llvm-svn: 213148
* Move clang/test/Frontend/rewrite-*.c to clang/test/Frontend/Rewriter/NAKAMURA Takumi2014-07-1621-1/+1
| | | | llvm-svn: 213146
* Trailing linefeed.NAKAMURA Takumi2014-07-161-2/+0
| | | | llvm-svn: 213145
* Avoid non-attributive uses of 'unsupported' in diagnosticsAlp Toker2014-07-141-1/+1
| | | | | | | | | | | | | We don't have a style guide for diagnostic messages, but convention strongly favours the forms: 'attribute is not supported', 'unsupported attribute' We generally avoid: 'attribute is unsupported', 'non-supported attribute' llvm-svn: 212972
* Provide -verify support to match "any" line for diagnostics in included files.Andy Gibbs2014-07-103-4/+32
| | | | | | | | Allow diagnostic checks that originate in included files to be matched without necessarily determining the line number that the diagnostic occurs on. The new syntax replaces the line number with '*'. This extension is limited to diagnostics in included files and may be used where the include file is not part of the test-suite itself. Expected uses are for diagnostics originating in system headers, or for users who use -verify in testing 3rd-party library code where the location of diagnostics in header files may change from revision to revision and their precise location is not important to the success of the test-case. llvm-svn: 212735
* clang-cl: /showIncludes output should go to stdout, not stderr. Fixes PR20217.Nico Weber2014-07-061-4/+4
| | | | llvm-svn: 212383
* Account for differences in grep implementationsAlp Toker2014-06-271-3/+3
| | | | llvm-svn: 211856
* Restore test from r211844 skipping '.file' directivesAlp Toker2014-06-271-8/+8
| | | | | | | At least this answers the question of whether .bc/.ll input processed by the frontend produces identical output to the original compilation. llvm-svn: 211853
* Partially disable test from r211844Alp Toker2014-06-271-2/+4
| | | | | | | ELF assembly contains .line directives that differ based on the input filename. Weaken the test while considering options. llvm-svn: 211849
* Add test coverage for .bc input in the frontendAlp Toker2014-06-271-0/+17
| | | | | | | | | | | | | Test that we can consume LLVM bitcode and additionally check that it produces the same output as a direct compilation. The feature is crashy and has gone untested until now, but we might as well provide some coverage as long as it remains in tree. Also test LL source input in the same way because the existing tests for that don't look convincing. llvm-svn: 211844
* Remove .bc from test config.suffixesAlp Toker2014-06-271-1/+1
| | | | | | This was unused. Besides, a binary file can't really contain lit ShTests. llvm-svn: 211843
* Simplify optimization-remark.c test following r211610Alp Toker2014-06-241-12/+7
| | | | | | | | | | With LocTrackingOnly there's no longer a user-facing distinction so the NDEBUG checks can go away. (Except maybe column info, but -verify only checks line numbers anyway.) Also add a RUN line to validate the traditional !LocTrackingOnly case. llvm-svn: 211622
* Fix test added in r211610 so it doesn't race on output file creation.David Blaikie2014-06-241-1/+1
| | | | llvm-svn: 211615
* Add new debug kind LocTrackingOnly.Diego Novillo2014-06-241-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This new debug emission kind supports emitting line location information in all instructions, but stops code generation from emitting debug info to the final output. This mode is useful when the backend wants to track source locations during code generation, but it does not want to produce debug info. This is currently used by optimization remarks (-Rpass, -Rpass-missed and -Rpass-analysis). When one of the -Rpass flags is used, the front end will enable location tracking, only if no other debug option is enabled. To prevent debug information from being generated, a new debug info kind LocTrackingOnly causes DIBuilder::createCompileUnit() to not emit the llvm.dbg.cu annotation. This blocks final code generation from generating debug info in the back end. Depends on D4234. Reviewers: echristo, dblaikie Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4235 llvm-svn: 211610
* Do not predefine __EXCEPTIONS in clang-cl (PR19977)Hans Wennborg2014-06-101-0/+6
| | | | | | | | Patch by Ehsan Akhgari! (Test tweak by me.) Differential Revision: http://reviews.llvm.org/D4065 llvm-svn: 210582
* Make '-Werror=frame-larger-than=' and associated diagnostic pragmas ↵Alp Toker2014-06-091-2/+2
| | | | | | | | | | | GCC-compatible It turns out the trailing '=' really is part of the option name spelling and treating it as such gets us compatible with GCC's -Werror= and pragmas. (GCC doesn't appear to support any -Wno- form for this diagnostic but we do.) llvm-svn: 210503
* 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! llvm-svn: 210326
* 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 llvm-svn: 210323
* 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). llvm-svn: 210294
* 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. llvm-svn: 210293
* Fix leak from r210059Alp Toker2014-06-031-3/+2
| | | | | | | Also revert r210096 which temporarily disabled the test while this was being investigated. llvm-svn: 210115
* 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) llvm-svn: 210096
* Fix -emit-codegen-only to not generate binariesAlp Toker2014-06-031-0/+7
| | | | llvm-svn: 210059
* Remove unnecessary test.Diego Novillo2014-05-301-28/+0
| | | | llvm-svn: 209893
* 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. llvm-svn: 209878
* 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 llvm-svn: 209839
* Add missing -S to avoid invoking assembler unnecessarily.Diego Novillo2014-05-291-1/+1
| | | | llvm-svn: 209828
* 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. llvm-svn: 209824
* 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. llvm-svn: 209823
* 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 llvm-svn: 208315
* -fsyntax-only for a testLubos Lunak2014-05-011-1/+1
| | | | llvm-svn: 207814
* 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. llvm-svn: 207810
* do not hide clang stderr output during a testLubos Lunak2014-05-011-2/+2
| | | | | | I don't know why this fails on the buildbot. llvm-svn: 207808
* 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. llvm-svn: 207797
* 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. llvm-svn: 207795
* do not use "1" for line marker for the predefines "file" eitherLubos Lunak2014-05-011-0/+9
| | | | | | Similar to r207764. llvm-svn: 207794
* 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. llvm-svn: 207765
* 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. llvm-svn: 207764
* 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. llvm-svn: 207762
* 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. llvm-svn: 207756
* Simplify test. No functional change intended.Andrea Di Biagio2014-04-301-1/+1
| | | | llvm-svn: 207623
* 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'. llvm-svn: 207576
* 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 llvm-svn: 206826
* 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. llvm-svn: 206412
* 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 llvm-svn: 206401
* 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 llvm-svn: 204775
* Accept -no-integrated-as in -cc1 and forward it to llvm.Rafael Espindola2014-02-211-4/+4
| | | | llvm-svn: 201837
* 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 llvm-svn: 201333
* 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. llvm-svn: 201241
OpenPOWER on IntegriCloud