aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Frontend
AgeCommit message (Collapse)AuthorFilesLines
2013-12-01Merging r195877:Bill Wendling2-0/+5
------------------------------------------------------------------------ r195877 | llunak | 2013-11-27 13:14:43 -0800 (Wed, 27 Nov 2013) | 3 lines strip UTF-8 BOM in -frewrite-includes (PR#15664) ------------------------------------------------------------------------ llvm-svn: 195987
2013-11-20Merging r195149:Bill Wendling1-3/+4
------------------------------------------------------------------------ r195149 | grosbach | 2013-11-19 12:18:39 -0800 (Tue, 19 Nov 2013) | 6 lines ARM: embedded v7 'darwin' doesn't get min-version defines. Make sure armv7 doesn't get the iOS deployment version definitions when it's being used for non-iOS. rdar://15497681 ------------------------------------------------------------------------ llvm-svn: 195225
2013-11-18Remove period at end of "optimization level is unsupported" diagnosticHans Wennborg1-1/+1
llvm-svn: 195048
2013-11-18Make test/Driver/clang_f_opts.c not write to the test dirHans Wennborg1-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. llvm-svn: 195047
2013-11-18Using an invalid -O falls back on -O3 instead of an errorSylvestre Ledru1-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 llvm-svn: 195009
2013-11-16Move remaining %clang_cc1 tests out of test/DriverAlp Toker3-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. llvm-svn: 194919
2013-11-15Ignore test Inputs globally and remove redundant lit.local.cfg filesAlp Toker1-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. llvm-svn: 194814
2013-11-05Fix test that was not being runAlp Toker1-1/+1
llvm-svn: 194070
2013-10-29Fix "existant" typosAlp Toker1-2/+2
llvm-svn: 193578
2013-10-24ARM-Darwin: Use the *-*-darwin-eabi triple for v6m & v7m archsTim Northover1-0/+6
These arch arguments are used for embedded targets (obviously) which need a different calling convention to iOS. llvm-svn: 193328
2013-08-29clang/test/Frontend/rewrite-includes.c: Tweak expressions for r'\\', not ↵NAKAMURA Takumi1-14/+14
r'\', on win32. llvm-svn: 189591
2013-08-29[tests] Use 'printf' instead of 'echo -e', which is not part of BSD echo.Daniel Dunbar1-1/+1
llvm-svn: 189562
2013-08-21Move -mfpmath handling to -cc1 and implement it for x86.Rafael Espindola1-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. llvm-svn: 188939
2013-08-09clang-cl: Support /showIncludesHans Wennborg1-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 llvm-svn: 188037
2013-08-07Indicate success for simple options when clang called with -cc1.Rafael Espindola1-0/+4
Patch by David Wiberg. llvm-svn: 187888
2013-07-26[frontend] '-frewrite-includes' should not ignore headers included from ↵Argyrios Kyrtzidis1-0/+7
command-line. rdar://14556182 llvm-svn: 187207
2013-07-20avoid bogus warnings about "unknown" pragmas with -frewrite-includes (pr#14831)Lubos Lunak1-0/+4
llvm-svn: 186764
2013-07-20fix sometimes incorrect line numbers in -frewrite-includes mode (pr#14795)Lubos Lunak1-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. llvm-svn: 186763
2013-07-04Add 'not' to commands that are expected to fail.Rafael Espindola7-17/+17
This is at least good documentation, but also opens the possibility of using pipefail. llvm-svn: 185652
2013-07-04Replace 'grep foo | count 0' with 'not grep foo'.Rafael Espindola1-5/+5
This avoids depending on pipefail not being used. llvm-svn: 185648
2013-06-28Update for llvm::sys::fs::unique_file not creating directories.Rafael Espindola1-1/+1
llvm-svn: 185127
2013-06-27Small improvements to createOutputFile.Rafael Espindola1-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. llvm-svn: 185091
2013-04-17Extended VerifyDiagnosticConsumer to also verify source file for diagnostic.Andy Gibbs1-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. llvm-svn: 179677
2013-04-16rewrite-includes: Rewrite __has_include(_next) to get rid of a host dependency.Benjamin Kramer3-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 llvm-svn: 179616
2013-04-11Follow Jordan's advice and use {{^}} and {{$}} for this testReid Kleckner1-4/+4
This is a better way of ensuring that we match the output of the rewriter and not the CHECK line. llvm-svn: 179308
2013-04-10FileCheck-ify some clang grep tests that use double quotesReid Kleckner1-5/+9
The escaping interaction between Python and grep doesn't work on my system. This change fixes the tests for me. llvm-svn: 179214
2013-04-10[frontend] -frewrite-includes: turn implicit module imports into @imports.Argyrios Kyrtzidis1-0/+20
rdar://13610250 llvm-svn: 179145
2013-04-10[frontend] -frewrite-includes: if there was no inclusion, don't add lineinfo ↵Argyrios Kyrtzidis1-1/+1
that indicates return from another file. llvm-svn: 179143
2013-04-02Escape # and $ in dependency files.Benjamin Kramer1-0/+17
Fixes PR15642. llvm-svn: 178540
2013-03-21Delayed template parsing is not supported by the AST serialization system ↵Aaron Ballman1-1/+1
yet, so turning it off. This fixes a test breakage caused by r177336. llvm-svn: 177655
2013-03-18[frontend] Initialize the diagnostic client before loading an ast file.Argyrios Kyrtzidis1-0/+22
Issue reported by Tom Honermann! http://llvm.org/bugs/show_bug.cgi?id=15377 llvm-svn: 177336
2013-01-15[driver] Warnings for warning options are handled by the frontend. The ↵Chad Rosier1-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 llvm-svn: 172497
2013-01-02hexagon-target-basic.c test: add REQUIRES line for hexagon targetDmitri Gribenko1-0/+1
llvm-svn: 171422
2013-01-02Correct Hexagon DataLayout string. Fixes bug 14744.Anshuman Dasgupta1-0/+8
Patch by Krzysztof Parzyszek! llvm-svn: 171415
2012-10-24A number of test cases assume that an "int" parameter or return valueUlrich Weigand1-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. llvm-svn: 166551
2012-10-19Change VerifyDiagnosticConsumer so that it *must* contain at least one ↵Andy Gibbs3-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. llvm-svn: 166281
2012-10-19Prior to adding the new "expected-no-diagnostics" directive to ↵Andy Gibbs5-0/+5
VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. llvm-svn: 166280
2012-10-19Fix directive parsing in VerifyDiagnosticConsumer so that it ensures that ↵Andy Gibbs1-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. llvm-svn: 166279
2012-09-25-iframework should allow separate arguments.Douglas Gregor1-1/+1
llvm-svn: 164607
2012-08-31don't warn about unused values when the unused value is a statement ↵Chris Lattner1-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. llvm-svn: 163034
2012-08-10Update VerifyDiagnosticConsumer to only get directives during parsing.Jordan Rose3-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. llvm-svn: 161650
2012-07-11Allow -verify directives to be filtered by preprocessing.Jordan Rose3-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). llvm-svn: 160068
2012-06-14Remove absolute path form include test.David Blaikie1-1/+1
Review feedback/bot failure from r158459 by Simon Atanasyan and Benjamin Kramer (on IRC). llvm-svn: 158464
2012-06-14Fix crash on missing header in -rewrite-includes.David Blaikie1-0/+7
llvm-svn: 158459
2012-06-14Rename -rewrite-includes to -frewrite-includes.David Blaikie1-46/+46
llvm-svn: 158458
2012-06-13Add -isystem-prefix and -ino-system-prefix arguments, which can be used toRichard Smith7-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. llvm-svn: 158418
2012-06-07test/Frontend/rewrite-includes.c: Tweak for win32's pathsep.NAKAMURA Takumi1-9/+9
llvm-svn: 158149
2012-06-06Add a -rewrite-includes option, which is similar to -rewrite-macros, but ↵David Blaikie8-0/+158
only expands #include directives. Patch contributed by Lubos Lunak (l.lunax@suse.cz). Review by Matt Beaumont-Gay (matthewbg@google.com). llvm-svn: 158093
2012-03-16Escape % in diagnostic message when compiling LLVM IR.Benjamin Kramer1-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 %. llvm-svn: 152956
2012-02-15Remove the unuseful -fdiagnostics-show-nameDavid Blaikie1-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. llvm-svn: 150612