summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor/line-directive.c
Commit message (Collapse)AuthorAgeFilesLines
* Switch C compilations to C11 by default.Richard Smith2014-10-201-1/+1
| | | | | | | | This is long-since overdue, and matches GCC 5.0. This should also be backwards-compatible, because we already supported all of C11 as an extension in C99 mode. llvm-svn: 220244
* Add 'not' to commands that are expected to fail.Rafael Espindola2013-07-041-2/+2
| | | | | | | This is at least good documentation, but also opens the possibility of using pipefail. llvm-svn: 185652
* Repeat some #line directive tests for the GNU line marker directive.Michael Ilseman2013-04-101-1/+8
| | | | llvm-svn: 179142
* Improve the diagnostics of the number-reading preprocessor directives.Michael Ilseman2013-04-101-1/+2
| | | | | | | | | | | | | | The GNU line marker directive was sharing code with the #line directive, but some of the warnings/errors were reporting as #line directive diagnostics in both cases. Previously: #line 11foo1 ==> "#line directive requires a simple digit sequence" # 11foo1 ==> "#line directive requires a simple digit sequence" Now, we get: #line 11foo1 ==> "#line directive requires a simple digit sequence" # 11foo1 ==> "GNU line marker directive requires a simple digit sequence" llvm-svn: 179139
* Allow -verify directives to be filtered by preprocessing.Jordan Rose2012-07-111-2/+5
| | | | | | | | | | | | | | | | | | | | | 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
* preprocessing: gcc supports #line 0. So, treat thisFariborz Jahanian2012-06-261-2/+5
| | | | | | | | as a gcc supported extension with usual treatment with -pedantic (warn) and -pedantic-errors (error). // rdar://11550996 llvm-svn: 159226
* Per discussion on cfe-dev, remove '#error' and '#warning' from diagnostic text.Ted Kremenek2012-02-021-2/+2
| | | | llvm-svn: 149566
* C11 allows typedefs to be redefined. Implement this in C11 mode, andDouglas Gregor2012-01-111-2/+2
| | | | | | | downgrade the default-error warning to an ExtWarn in C90/99. <rdar://problem/10668057> llvm-svn: 147925
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-3/+3
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Remove unnecessary -fms-extensions=0 from tests (this command line syntax is ↵Daniel Dunbar2009-11-291-1/+1
| | | | | | going away). llvm-svn: 90066
* Eliminate &&s in tests.Daniel Dunbar2009-11-081-2/+2
| | | | | | - 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious. llvm-svn: 86430
* Disabling some MS extensions which cause these tests to failJohn Thompson2009-10-271-1/+1
| | | | llvm-svn: 85236
* Change our silencing of C typedef redefinition handling to what we hadChris Lattner2009-04-271-2/+5
| | | | | | | | before r69391: typedef redefinition is an error by default, but if *either* the old or new definition are from a system header, we silence it. llvm-svn: 70177
* make -Wtypedef-redefinition an extwarn instead of defaultingChris Lattner2009-04-271-2/+2
| | | | | | to error, doing this breaks too many programs (e.g. Adium). llvm-svn: 70170
* Fix PR3917: the location of a #line directive is the location of the first _.Chris Lattner2009-04-181-0/+8
| | | | llvm-svn: 69485
* more fun with line markers: the digit string is required to be interpretedChris Lattner2009-04-181-2/+8
| | | | | | | as decimal, even if it starts with 0. Also, since things like 0x1 are completely illegal, don't even bother using numericliteralparser for them. llvm-svn: 69454
* second half of PR3940: #line requires simple digit sequence.Chris Lattner2009-04-181-0/+3
| | | | llvm-svn: 69422
* implement PR3940: #line numbers not fully checkedChris Lattner2009-04-171-0/+2
| | | | llvm-svn: 69403
* #line is allowed to have macros that expand to nothing after them.Chris Lattner2009-04-171-0/+8
| | | | llvm-svn: 69401
* tweak redefinition of a typedef a bit to fix a couple of problems:Chris Lattner2009-04-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | 1. We had logic in sema to decide whether or not to emit the error based on manually checking whether in a system header file. 2. we were allowing redefinitions of typedefs in class scope in C++ if in header file. 3. there was no way to force typedef redefinitions to be accepted by the C compiler, which annoys me when stripping linemarkers out of .i files. The fix is to split the C++ class typedef redefinition path from the C path, and change the C path to be a warning that normally maps to error. This causes it to properly be ignored in system headers, etc. and gives us a way to control it. Passing -Wtypedef-redefinition now turns the error into a warning. One behavior change is that we now diagnose cases where you redefine a typedef in your .c file that was defined in a header file. This seems like reasonable behavior, and the diagnostic now indicates that it can be controlled with -Wtypedef-redefinition. llvm-svn: 69391
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-3/+3
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Implement handling of file entry/exit notifications from GNUChris Lattner2009-02-041-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | line markers, including maintenance of the virtual include stack. For something like this: # 42 "bar.c" 1 # 142 "bar2.c" 1 #warning zappa # 92 "bar.c" 2 #warning gonzo # 102 "foo.c" 2 #warning bonkta we now produce these three warnings: #1: In file included from foo.c:3: In file included from bar.c:42: bar2.c:143:2: warning: #warning zappa #warning zappa ^ #2: In file included from foo.c:3: bar.c:92:2: warning: #warning gonzo #warning gonzo ^ #3: foo.c:102:2: warning: #warning bonkta #warning bonkta ^ llvm-svn: 63722
* # 42 doesn't change system header state either, add test.Chris Lattner2009-02-041-0/+5
| | | | llvm-svn: 63721
* make getFileCharacteristic linetable aware. line markers that Chris Lattner2009-02-041-0/+20
| | | | | | play around with the 'is system header' bit now function correctly. llvm-svn: 63720
* Add simple #line directive test.Chris Lattner2009-02-041-1/+10
| | | | llvm-svn: 63713
* add parsing and constraint enforcement for GNU line marker directives.Chris Lattner2009-01-261-0/+13
| | | | llvm-svn: 63003
* add another sanity test.Chris Lattner2009-01-261-0/+4
| | | | llvm-svn: 63001
* parse and enforce required constraints on #line directives. Right nowChris Lattner2009-01-261-0/+10
we just discard them. llvm-svn: 62999
OpenPOWER on IntegriCloud