summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor
Commit message (Collapse)AuthorAgeFilesLines
* fix PR3579: __LINE__ expands to the presumed location of the Chris Lattner2009-02-151-1/+10
| | | | | | | | *end* of a macro instantiation, not the start of it. This is really all about bug-for-bug compatibility with GCC, but not doing this breaks the FreeBSD kernel. llvm-svn: 64603
* track "just a little more" location information for macro instantiations.Chris Lattner2009-02-151-3/+3
| | | | | | | | | | | | Now instead of just tracking the expansion history, also track the full range of the macro that got replaced. For object-like macros, this doesn't change anything. For _Pragma and function-like macros, this means we track the locations of the ')'. This is required for PR3579 because apparently GCC uses the line of the ')' of a function-like macro as the location to expand __LINE__ to. llvm-svn: 64601
* Fix limits.h for linux, as glibc does a #include_next unlessMike Stump2009-02-121-0/+3
| | | | | | | | | _GCC_LIMITS_H_ is defined, when __GNUC__ is defined. Also, we need to stay away from possible conflicts with header guards. We should use CLANG_ to prefix all header guards. llvm-svn: 64408
* Add an implementation of -dM that follows GCC closely enough to permitChris Lattner2009-02-061-0/+31
| | | | | | | diffing the output of: clang -dM -o - -E -x c foo.c | sort llvm-svn: 63926
* smaller header.Chris Lattner2009-02-041-1/+1
| | | | llvm-svn: 63766
* Fix PR3464 by searching for headers from the predefinesChris Lattner2009-02-042-5/+3
| | | | | | buffer as if the #include happened from the main file. llvm-svn: 63764
* Ok, we need a system header for this test to pass in the clang/test ↵Chris Lattner2009-02-041-2/+2
| | | | | | directory as well as from the pp directory. llvm-svn: 63763
* fix testChris Lattner2009-02-041-1/+2
| | | | llvm-svn: 63762
* rename againChris Lattner2009-02-041-0/+0
| | | | llvm-svn: 63761
* rename some testsChris Lattner2009-02-042-2/+8
| | | | llvm-svn: 63759
* include smaller header for test.Chris Lattner2009-02-041-1/+1
| | | | llvm-svn: 63758
* 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 testcase for PR3437 and r63405Chris Lattner2009-01-301-2/+4
| | | | llvm-svn: 63407
* Introduce a new PresumedLoc class to represent the concept of a locationChris Lattner2009-01-271-1/+1
| | | | | | | | | | | | | | | | | | | as reported to the user and as manipulated by #line. This is what __FILE__, __INCLUDE_LEVEL__, diagnostics and other things should follow (but not dependency generation!). This patch also includes several cleanups along the way: - SourceLocation now has a dump method, and several other places that did similar things now use it. - I cleaned up some code in AnalysisConsumer, but it should probably be simplified further now that NamedDecl is better. - TextDiagnosticPrinter is now simplified and cleaned up a bit. This patch is a prerequisite for #line, but does not actually provide any #line functionality. llvm-svn: 63098
* Fix a bug that I noticed by inspection.Chris Lattner2009-01-271-0/+9
| | | | llvm-svn: 63094
* 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
* fix rdar://6505352 - Bogus warning with -WUndef, a caseChris Lattner2009-01-181-1/+7
| | | | | | Anders noticed. llvm-svn: 62472
* Make -E mode propagate #pragma comment's into the output.Chris Lattner2009-01-161-1/+3
| | | | llvm-svn: 62339
* Implement basic support for parsing #pragma comment, a microsoft extensionChris Lattner2009-01-161-0/+18
| | | | | | | | | | documented here: http://msdn.microsoft.com/en-us/library/7f0aews7(VS.80).aspx This is according to my understanding reading the docs, I don't know if it really agrees fully with what VC++ allows. llvm-svn: 62317
* Change some terminology in SourceLocation: instead of referring to Chris Lattner2009-01-161-1/+1
| | | | | | | the "physical" location of tokens, refer to the "spelling" location. This is more concrete and useful, tokens aren't really physical objects! llvm-svn: 62309
* Add test case for __ASSEMBLER__ definition.Daniel Dunbar2008-12-011-0/+6
| | | | llvm-svn: 60363
* testcase for PR3096Chris Lattner2008-11-211-0/+5
| | | | llvm-svn: 59794
* remove this testcase, it fails with -verify stillTorok Edwin2008-11-181-3/+0
| | | | llvm-svn: 59539
* fix test. it now crashes, but thats another problem..Nuno Lopes2008-11-181-2/+2
| | | | llvm-svn: 59537
* add testcase for PR3093Torok Edwin2008-11-181-0/+3
| | | | llvm-svn: 59534
* Skip random pathname characters better. I had a 5 in mine.Mike Stump2008-10-271-1/+1
| | | | llvm-svn: 58291
* Add a new -dump-raw-tokens option, which allows us to see raw tokens. Chris Lattner2008-10-121-1/+1
| | | | | | Rename -dumptokens to -dump-tokens. llvm-svn: 57405
* switch to using -verifyChris Lattner2008-10-041-2/+2
| | | | llvm-svn: 57068
* testcase for my previous patch.Chris Lattner2008-09-261-0/+2
| | | | llvm-svn: 56670
* - Implement __block.Steve Naroff2008-09-021-0/+10
| | | | | | - Replace FIXME in Preprocessor::HandleIdentifier() with a check that avoids diagnosing extension tokens that originate from macro definitions. llvm-svn: 55639
* make test fails if llvm is checked out to llvm-svn of if there is a dash ↵Nico Weber2008-08-221-1/+1
| | | | | | somewhere else in the path. fix that. llvm-svn: 55175
* fix testNuno Lopes2008-07-191-1/+1
| | | | llvm-svn: 53802
* Patch by Kovarththanan Rajaratnam:Ted Kremenek2008-07-191-0/+5
| | | | | | | "When dumping the tokens (-dumptokens output type), the column numbers are not correctly shown. This patch fixes that issue." llvm-svn: 53797
* Multiple tests in a single test file must be linked with '&&'.Argyrios Kyrtzidis2008-06-126-11/+11
| | | | | | Otherwise, failing tests other than the last one will not be reported. llvm-svn: 52231
* The awesome GNU "comma elision extension" works with both the standardChris Lattner2008-05-081-0/+3
| | | | | | | __VA_ARGS__ syntax as well as with the amazingly awesome GNU "named variadic macro" extension. Allow it with the GNU syntax as well. llvm-svn: 50843
* Fix a few more bugs in preprocessor expressions w.r.t. ?:. Now I Chris Lattner2008-05-052-0/+9
| | | | | | think it is really right. :) This fixes PR2284. llvm-svn: 50665
* fix a bug handling right associative operators that Neil noticed, hopefullyChris Lattner2008-05-051-0/+3
| | | | | | the final part of PR2279 llvm-svn: 50635
* Fix the rest of PR2279:Chris Lattner2008-05-041-0/+10
| | | | | | | | | a) correct rejection of ',' in pp expressions. b) the precedence of ',' was wrong w.r.t. ?:. Thanks again to Neil for finding these and providing testcases. llvm-svn: 50625
* Fix PR2279 part C: shifts don't perform the UACs, thanks to Neil Chris Lattner2008-05-041-0/+5
| | | | | | for pointing this out. llvm-svn: 50624
* fix a nasty bug that Neil identifier in pp-expr parsing (this is PR2279 part D).Chris Lattner2008-05-041-0/+7
| | | | llvm-svn: 50617
* Fix PR2220, making diagnostics for unexpected tokens in pp expressions Chris Lattner2008-04-131-0/+10
| | | | | | more nice. llvm-svn: 49619
* fix this test.Chris Lattner2008-03-221-1/+1
| | | | llvm-svn: 48668
* Only invoke the preprocessor; it's the only thing being tested. Also, checkSam Bishop2008-03-211-1/+2
| | | | | | the output to make sure that the macros and comments are being treated as such. llvm-svn: 48638
* Use the -E option when invoking clang. Only the preprocessor isSam Bishop2008-03-212-2/+2
| | | | | | required to perform this test. llvm-svn: 48636
* remove two obsolete tests, not sure why my previous commit didn't commit the ↵Chris Lattner2008-03-062-54/+0
| | | | | | removal. llvm-svn: 47986
OpenPOWER on IntegriCloud