summaryrefslogtreecommitdiff
path: root/test/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* Using an invalid -O falls back on -O3 instead of an errorSylvestre Ledru2013-11-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently with clang: $ clang -O20 foo.c error: invalid value '20' in '-O20' With the patch: $ clang -O20 foo.c warning: optimization level '-O20' is unsupported; using '-O3' instead. 1 warning generated. This matches the gcc behavior (with a warning added) Pass all tests: Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. Testing Time: 94.14s Expected Passes : 6721 Expected Failures : 20 Unsupported Tests : 17 (which was not the case of http://llvm-reviews.chandlerc.com/D2125) Differential Revision: http://llvm-reviews.chandlerc.com/D2212 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195009 91177308-0d34-0410-b5e6-96231b3b80d8
* Move remaining %clang_cc1 tests out of test/DriverAlp Toker2013-11-163-0/+60
| | | | | | | | | | | | | | clang -cc1 skips the driver so it never made sense to include these with the Driver tests. Basic type tests and flag tests generally both go in Frontend. Now that the final -cc1 tests have been moved out of test/Driver, add a local substitution to enforce and detect future mistakes. These miscategorized tests were probably the source of confusion in r194817. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194919 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignore test Inputs globally and remove redundant lit.local.cfg filesAlp Toker2013-11-151-1/+0
| | | | | | | | | | By adding a default config.excludes pattern we can avoid individual suppressions in subdirectories. This matches LLVM's lit.cfg which also excludes a few other common non-test filenames for consistency. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194814 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix test that was not being runAlp Toker2013-11-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194070 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix "existant" typosAlp Toker2013-10-291-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193578 91177308-0d34-0410-b5e6-96231b3b80d8
* ARM-Darwin: Use the *-*-darwin-eabi triple for v6m & v7m archsTim Northover2013-10-241-0/+6
| | | | | | | These arch arguments are used for embedded targets (obviously) which need a different calling convention to iOS. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193328 91177308-0d34-0410-b5e6-96231b3b80d8
* clang/test/Frontend/rewrite-includes.c: Tweak expressions for r'\\', not ↵NAKAMURA Takumi2013-08-291-14/+14
| | | | | | r'\', on win32. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189591 91177308-0d34-0410-b5e6-96231b3b80d8
* [tests] Use 'printf' instead of 'echo -e', which is not part of BSD echo.Daniel Dunbar2013-08-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189562 91177308-0d34-0410-b5e6-96231b3b80d8
* Move -mfpmath handling to -cc1 and implement it for x86.Rafael Espindola2013-08-211-0/+43
| | | | | | | | | | | | | | | | | | | | | | | The original idea was to implement it all on the driver, but to do that the driver needs to know the sse level and to do that it has to know the default features of a cpu. Benjamin Kramer pointed out that if one day we decide to implement support for ' __attribute__ ((__target__ ("arch=core2")))', then the frontend needs to keep its knowledge of default features of a cpu. To avoid duplicating which part of clang handles default cpu features, it is probably better to handle -mfpmath in the frontend. For ARM this patch is just a small improvement. Instead of a cpu list, we check if neon is enabled, which allows us to reject things like -mcpu=cortex-a9 -mfpu=vfp -mfpmath=neon For X86, since LLVM doesn't support an independent ssefp feature, we just make sure the selected -mfpmath matches the sse level. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188939 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-cl: Support /showIncludesHans Wennborg2013-08-091-0/+7
| | | | | | | | | | This option prints information about #included files to stderr. Clang could already do it, this patch just teaches the existing code about the /showIncludes style and adds the flag. Differential Revision: http://llvm-reviews.chandlerc.com/D1333 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188037 91177308-0d34-0410-b5e6-96231b3b80d8
* Indicate success for simple options when clang called with -cc1.Rafael Espindola2013-08-071-0/+4
| | | | | | Patch by David Wiberg. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187888 91177308-0d34-0410-b5e6-96231b3b80d8
* [frontend] '-frewrite-includes' should not ignore headers included from ↵Argyrios Kyrtzidis2013-07-261-0/+7
| | | | | | | | command-line. rdar://14556182 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187207 91177308-0d34-0410-b5e6-96231b3b80d8
* avoid bogus warnings about "unknown" pragmas with -frewrite-includes (pr#14831)Lubos Lunak2013-07-201-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186764 91177308-0d34-0410-b5e6-96231b3b80d8
* fix sometimes incorrect line numbers in -frewrite-includes mode (pr#14795)Lubos Lunak2013-07-201-6/+15
| | | | | | | | | | Every #include is surrounded by #if 0 in order to comment it out, which adds lines. That is fixed up right after, but that all can be inside #if part that is not processed, so fix up also after every end of a conditional part. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186763 91177308-0d34-0410-b5e6-96231b3b80d8
* Add 'not' to commands that are expected to fail.Rafael Espindola2013-07-047-17/+17
| | | | | | | This is at least good documentation, but also opens the possibility of using pipefail. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185652 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace 'grep foo | count 0' with 'not grep foo'.Rafael Espindola2013-07-041-5/+5
| | | | | | This avoids depending on pipefail not being used. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185648 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for llvm::sys::fs::unique_file not creating directories.Rafael Espindola2013-06-281-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185127 91177308-0d34-0410-b5e6-96231b3b80d8
* Small improvements to createOutputFile.Rafael Espindola2013-06-271-1/+1
| | | | | | | | * Use a single stat to find out if the file exists and if it is a regular file. * Use early returns when possible. * Add comments explaining why we have each check. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185091 91177308-0d34-0410-b5e6-96231b3b80d8
* Extended VerifyDiagnosticConsumer to also verify source file for diagnostic.Andy Gibbs2013-04-171-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VerifyDiagnosticConsumer previously would not check that the diagnostic and its matching directive referenced the same source file. Common practice was to create directives that referenced other files but only by line number, and this led to problems such as when the file containing the directive didn't have enough lines to match the location of the diagnostic in the other file, leading to bizarre file formatting and other oddities. This patch causes VerifyDiagnosticConsumer to match source files as well as line numbers. Therefore, a new syntax is made available for directives, for example: // expected-error@file:line {{diagnostic message}} This extends the @line feature where "file" is the file where the diagnostic is generated. The @line syntax is still available and uses the current file for the diagnostic. "file" can be specified either as a relative or absolute path - although the latter has less usefulness, I think! The #include search paths will be used to locate the file and if it is not found an error will be generated. The new check is not optional: if the directive is in a different file to the diagnostic, the file must be specified. Therefore, a number of test-cases have been updated with regard to this. This closes out PR15613. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179677 91177308-0d34-0410-b5e6-96231b3b80d8
* rewrite-includes: Rewrite __has_include(_next) to get rid of a host dependency.Benjamin Kramer2013-04-163-0/+41
| | | | | | | | | | | | | | This broke e.g. compiling a crash report from a glibc system on Darwin. Sadly, the implementation had to game the lexer a lot as we're not using a real preprocessor here. It also doesn't handle special cases like arbitrary macros in __has_include, but since this macro isn't common outside of clang's headers we can get away with that. Fixes PR14422. Differential Revision: http://llvm-reviews.chandlerc.com/D594 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179616 91177308-0d34-0410-b5e6-96231b3b80d8
* Follow Jordan's advice and use {{^}} and {{$}} for this testReid Kleckner2013-04-111-4/+4
| | | | | | | This is a better way of ensuring that we match the output of the rewriter and not the CHECK line. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179308 91177308-0d34-0410-b5e6-96231b3b80d8
* FileCheck-ify some clang grep tests that use double quotesReid Kleckner2013-04-101-5/+9
| | | | | | | The escaping interaction between Python and grep doesn't work on my system. This change fixes the tests for me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179214 91177308-0d34-0410-b5e6-96231b3b80d8
* [frontend] -frewrite-includes: turn implicit module imports into @imports.Argyrios Kyrtzidis2013-04-101-0/+20
| | | | | | rdar://13610250 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179145 91177308-0d34-0410-b5e6-96231b3b80d8
* [frontend] -frewrite-includes: if there was no inclusion, don't add lineinfo ↵Argyrios Kyrtzidis2013-04-101-1/+1
| | | | | | that indicates return from another file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179143 91177308-0d34-0410-b5e6-96231b3b80d8
* Escape # and $ in dependency files.Benjamin Kramer2013-04-021-0/+17
| | | | | | Fixes PR15642. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178540 91177308-0d34-0410-b5e6-96231b3b80d8
* Delayed template parsing is not supported by the AST serialization system ↵Aaron Ballman2013-03-211-1/+1
| | | | | | yet, so turning it off. This fixes a test breakage caused by r177336. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177655 91177308-0d34-0410-b5e6-96231b3b80d8
* [frontend] Initialize the diagnostic client before loading an ast file.Argyrios Kyrtzidis2013-03-181-0/+22
| | | | | | | Issue reported by Tom Honermann! http://llvm.org/bugs/show_bug.cgi?id=15377 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177336 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver] Warnings for warning options are handled by the frontend. The ↵Chad Rosier2013-01-151-0/+5
| | | | | | | | | | driver needs to process the warning options to setup diagnostic state, but should not be emitting warnings as these would be rudndant with what the frontend emits. rdar://13001556 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172497 91177308-0d34-0410-b5e6-96231b3b80d8
* hexagon-target-basic.c test: add REQUIRES line for hexagon targetDmitri Gribenko2013-01-021-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171422 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct Hexagon DataLayout string. Fixes bug 14744.Anshuman Dasgupta2013-01-021-0/+8
| | | | | | | Patch by Krzysztof Parzyszek! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171415 91177308-0d34-0410-b5e6-96231b3b80d8
* A number of test cases assume that an "int" parameter or return valueUlrich Weigand2012-10-241-2/+2
| | | | | | | | | | | | | will be represented in the IR as a plain "i32" type. This causes the tests to spuriously fail on platforms where int is not a 32-bit type, or where the ABI requires attributes like "signext" or "zeroext" to be used. This patch adds -triple or -target parameters to force those tests to use the i386-unknown-unknown target. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166551 91177308-0d34-0410-b5e6-96231b3b80d8
* Change VerifyDiagnosticConsumer so that it *must* contain at least one ↵Andy Gibbs2012-10-193-5/+48
| | | | | | | | | | "expected-*" directive. As a result, for test-cases that are not expected to generate any diagnostics, an additional directive "expected-no-diagnostics" has been implemented which can then be included in such test-cases. This new directive may not be used in conjunction with any other "expected-*" directive. This change was initially proposed as a solution to the problem highlighted by check-in r164677, i.e. that -verify will not cause a test-case failure where the compile command does not actually reference the file. Patch reviewed by David Blaikie. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166281 91177308-0d34-0410-b5e6-96231b3b80d8
* Prior to adding the new "expected-no-diagnostics" directive to ↵Andy Gibbs2012-10-195-0/+5
| | | | | | VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166280 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix directive parsing in VerifyDiagnosticConsumer so that it ensures that ↵Andy Gibbs2012-10-191-1/+1
| | | | | | | | "expected" is at the start of the word and will no longer accept typos such as "junkexpected-*" as a valid "expected-*" directive. A very few test-cases had to be amended to adhere to the new rule. Patch reviewed by David Blaikie. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166279 91177308-0d34-0410-b5e6-96231b3b80d8
* -iframework should allow separate arguments.Douglas Gregor2012-09-251-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164607 91177308-0d34-0410-b5e6-96231b3b80d8
* don't warn about unused values when the unused value is a statement ↵Chris Lattner2012-08-311-0/+8
| | | | | | expression expanded from a macro. This is of dubious utility in general, but is specifically a major issue for the linux kernel. This resolves PR13747. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163034 91177308-0d34-0410-b5e6-96231b3b80d8
* Update VerifyDiagnosticConsumer to only get directives during parsing.Jordan Rose2012-08-103-0/+39
| | | | | | | | | | | | | | | | | | | | The old behavior was to re-scan any files (like modules) where we may have directives but won't actually be parsing during the -verify invocation. Now, we keep the old behavior in Debug builds as a sanity check (though modules are a known entity), and expect all legitimate directives to come from comments seen by the preprocessor. This also affects the ARC migration tool, which captures diagnostics in order to filter some out. This change adds an explicit cleanup to CaptureDiagnosticsConsumer in order to let its sub-consumer handle the real end of diagnostics. This was originally split into four patches, but the tests do not run cleanly without all four, so I've combined them into one commit. Patches by Andy Gibbs, with slight modifications from me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161650 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow -verify directives to be filtered by preprocessing.Jordan Rose2012-07-113-0/+124
| | | | | | | | | | | | | | | | | | | | | This is accomplished by making VerifyDiagnosticsConsumer a CommentHandler, which then only reads the -verify directives that are actually in live blocks of code. It also makes it simpler to handle -verify directives that appear in header files, though we still have to manually reparse some files depending on how they are generated. This requires some test changes. In particular, all PCH tests now have their -verify directives outside the "header" portion of the file, using the @line syntax added in r159978. Other tests have been modified mostly to make it clear what is being tested, and to prevent polluting the expected output with the directives themselves. Patch by Andy Gibbs! (with slight modifications) The new Frontend/verify-* tests exercise the functionality of this commit, as well as r159978, r159979, and r160053 (Andy's other -verify enhancements). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160068 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove absolute path form include test.David Blaikie2012-06-141-1/+1
| | | | | | Review feedback/bot failure from r158459 by Simon Atanasyan and Benjamin Kramer (on IRC). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158464 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix crash on missing header in -rewrite-includes.David Blaikie2012-06-141-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158459 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename -rewrite-includes to -frewrite-includes.David Blaikie2012-06-141-46/+46
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158458 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -isystem-prefix and -ino-system-prefix arguments, which can be used toRichard Smith2012-06-137-0/+25
| | | | | | | | | | | override whether headers are system headers by checking for prefixes of the header name specified in the #include directive. This allows warnings to be disabled for third-party code which is found in specific subdirectories of include paths. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158418 91177308-0d34-0410-b5e6-96231b3b80d8
* test/Frontend/rewrite-includes.c: Tweak for win32's pathsep.NAKAMURA Takumi2012-06-071-9/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158149 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a -rewrite-includes option, which is similar to -rewrite-macros, but ↵David Blaikie2012-06-068-0/+158
| | | | | | | | | only expands #include directives. Patch contributed by Lubos Lunak (l.lunax@suse.cz). Review by Matt Beaumont-Gay (matthewbg@google.com). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158093 91177308-0d34-0410-b5e6-96231b3b80d8
* Escape % in diagnostic message when compiling LLVM IR.Benjamin Kramer2012-03-161-2/+2
| | | | | | | % is a common character in IR so we'd crash on almost any malformed IR. The diagnostic formatter expects a formatting directive when it sees an unescaped %. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152956 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the unuseful -fdiagnostics-show-nameDavid Blaikie2012-02-151-5/+0
| | | | | | | | | | | | | | This option was added in r129614 and doesn't have any use case that I'm aware of. It's possible that external tools are using these names - and if that's the case we can certainly reassess the functionality, but for now it lets us shave out a few unneeded bits from clang. Move the "StaticDiagNameIndex" table into the only remaining consumer, diagtool. This removes the actual diagnostic name strings from clang entirely. Reviewed by Chris Lattner & Ted Kremenek. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150612 91177308-0d34-0410-b5e6-96231b3b80d8
* Per discussion on cfe-dev, remove '#error' and '#warning' from diagnostic text.Ted Kremenek2012-02-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149566 91177308-0d34-0410-b5e6-96231b3b80d8
* Add test for -Wno-everything.Argyrios Kyrtzidis2012-01-271-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149123 91177308-0d34-0410-b5e6-96231b3b80d8
* rename -ccc-host-triple into -targetSebastian Pop2012-01-201-10/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148582 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r148138; it's causing test failures.Eli Friedman2012-01-131-10/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148141 91177308-0d34-0410-b5e6-96231b3b80d8