Commit Graph

74 Commits

Author SHA1 Message Date
Chris Lattner
a30be59fa2 Fix a nasty corner case that Neil noticed in PR1900, where we would
incorrectly apply the multiple include optimization to files with 
guards like:

#if !defined(x) MACRO

where MACRO could expand to different things in different contexts.
Thanks Neil!

llvm-svn: 45716
2008-01-07 19:50:27 +00:00
Chris Lattner
58c8be81bb add run line
llvm-svn: 44917
2007-12-12 06:20:40 +00:00
Chris Lattner
2fbe8e98c4 add runline, make this test real.
llvm-svn: 44916
2007-12-12 06:20:18 +00:00
Chris Lattner
3ed83c1c0f The flags on tokens indicate whether they are the start of a *physical* line,
not the start of a logical line.  Be careful about this distinction, which 
affects when newlines are printed and when paste-avoidance happens, etc.  
This fixes PR1848, thanks to Neil for noticing this!

llvm-svn: 44743
2007-12-09 21:11:08 +00:00
Chris Lattner
9fcdc52243 Fix PR1820, an incredibly subtle macro expansion bug that Neil discovered.
Neil, please review this fix.

llvm-svn: 44285
2007-11-23 06:50:21 +00:00
Chris Lattner
609d413363 fix a bug Steve noticed, where a #import of the main file itself would fail.
llvm-svn: 44178
2007-11-15 19:07:47 +00:00
Chris Lattner
d05e44e74e If we see an invalid #ifdef directive, enter a conditional compilation region
so that we don't emit an error on the #endif.  Suggestion by Neil.

llvm-svn: 42258
2007-09-24 05:14:57 +00:00
Chris Lattner
43eafb4ed5 implement a missing feature in the #include handler, where
it did not handle <xyz> headers coming from macro expansions.
This requires special treatment, as the include name is lexed
as multiple tokens, which require reassembly before processing.

llvm-svn: 40418
2007-07-23 04:56:47 +00:00
Chris Lattner
24dbee71ab Fix a stringizing bug that Neil noticed. We should preprocess this:
#define t(x) #x
t(a
c)

to "a c", not "ac".

llvm-svn: 40060
2007-07-19 16:11:58 +00:00
Chris Lattner
5c98379b1c Correctly respect C99 5.1.1.2p4 when searching for the first '(' of
a function-like macro invocation.  Patch contributed by Neil Booth.

llvm-svn: 40026
2007-07-19 00:07:36 +00:00
Chris Lattner
99ca091b9c Warn when performing 'usual' conversions that require a sign change. This
implements test/Preprocessor/expr_usual_conversions.c, which produces this
output:

expr_usual_conversions.c:5:10: warning: left side of operator converted from negative value to unsigned: -42 to 18446744073709551574
#if (-42 + 0U) / -2
         ^
expr_usual_conversions.c:5:16: warning: right side of operator converted from negative value to unsigned: -2 to 18446744073709551614
#if (-42 + 0U) / -2
               ^

llvm-svn: 39406
2007-04-11 04:14:45 +00:00
Chris Lattner
9e2fcccc33 Fix run line
llvm-svn: 39401
2007-04-10 07:06:36 +00:00
Chris Lattner
a7fa1b247c 'true' in a CPP expression evaluates to 1 when in C++ mode. This implements
test/Preprocessor/cxx_true.cpp

llvm-svn: 39399
2007-04-10 06:16:30 +00:00
Chris Lattner
6acf759735 new testcase
llvm-svn: 39396
2007-04-10 05:25:39 +00:00
Chris Lattner
1b65aaef2b improve this test to also check -fno-operator-keywords.
llvm-svn: 39246
2006-12-04 18:00:36 +00:00
Chris Lattner
c5b966f893 check minutia of the standard.
llvm-svn: 39215
2006-11-21 17:31:32 +00:00
Chris Lattner
5b9f4891d7 Add support for C++ operator keywords. Patch by Bill Wendling.
llvm-svn: 39214
2006-11-21 17:23:33 +00:00
Chris Lattner
ce999c490a new testcase
llvm-svn: 39068
2006-10-27 05:43:33 +00:00
Chris Lattner
a32cda40b5 make this harder
llvm-svn: 39054
2006-10-25 06:21:19 +00:00
Chris Lattner
1178cbd941 new testcase
llvm-svn: 39053
2006-10-25 06:18:35 +00:00
Chris Lattner
2bda2df3dc new testcase
llvm-svn: 39020
2006-10-20 05:08:12 +00:00
Chris Lattner
02846975da new testcase
llvm-svn: 38982
2006-10-14 19:53:37 +00:00
Chris Lattner
3e8b4d2854 new testcase for #define_target.
llvm-svn: 38981
2006-10-14 19:09:13 +00:00
Chris Lattner
8f46a38503 new testcase
llvm-svn: 38953
2006-10-06 02:59:40 +00:00
Chris Lattner
cc211add25 Make this testcase pass the right arg.
llvm-svn: 38829
2006-08-06 18:31:20 +00:00
Chris Lattner
b10969b9b2 new testcase
llvm-svn: 38799
2006-07-30 07:33:49 +00:00
Chris Lattner
022b62e941 new testcase
llvm-svn: 38798
2006-07-30 07:20:09 +00:00
Chris Lattner
8d31b5d1aa new testcase
llvm-svn: 38794
2006-07-29 07:32:40 +00:00
Chris Lattner
2641bd549c new testcase
llvm-svn: 38792
2006-07-29 07:19:41 +00:00
Chris Lattner
5b123fde96 new testcase
llvm-svn: 38790
2006-07-29 07:08:39 +00:00
Chris Lattner
b631d7ce6c new testcase
llvm-svn: 38789
2006-07-29 06:59:47 +00:00
Chris Lattner
232daf6834 testcase from the c99 standard
llvm-svn: 38788
2006-07-29 06:48:55 +00:00
Chris Lattner
15d6b28f09 new testcase
llvm-svn: 38786
2006-07-29 06:44:19 +00:00
Chris Lattner
f35d327a99 Testcases for comment saving modes, -C and -CC.
llvm-svn: 38785
2006-07-29 06:41:10 +00:00
Chris Lattner
d480b9c0ed new testcase for the GNU comma swallow extension.
llvm-svn: 38779
2006-07-29 04:39:12 +00:00
Chris Lattner
63081842a7 new testcase for placemarker handling.
llvm-svn: 38777
2006-07-29 04:09:49 +00:00
Chris Lattner
2bc48570b7 new testcase for __VA_ARGS__
llvm-svn: 38775
2006-07-29 04:03:59 +00:00
Chris Lattner
f30dcbe07e new testcase
llvm-svn: 38768
2006-07-29 01:24:46 +00:00
Chris Lattner
3961e60991 Tweak expected results do to paste avoidance.
llvm-svn: 38766
2006-07-28 06:55:35 +00:00
Chris Lattner
341c9a1615 new testcase for paste avoidance
llvm-svn: 38765
2006-07-28 06:54:07 +00:00
Chris Lattner
b1d2594456 Add test for pasting empty formals
llvm-svn: 38763
2006-07-28 05:13:36 +00:00
Chris Lattner
fdc0abe619 new testcase
llvm-svn: 38759
2006-07-27 06:17:55 +00:00
Chris Lattner
0f1f50517b Simplify identifier lookup in raw mode, implementing Preprocessor/macro_fn_lparen_scan2.c.
llvm-svn: 38744
2006-07-20 04:16:23 +00:00
Chris Lattner
9100cff701 new testcase
llvm-svn: 38743
2006-07-19 08:13:21 +00:00
Chris Lattner
ae637cd2a9 new testcase from c99 rationale
llvm-svn: 38742
2006-07-19 08:04:22 +00:00
Chris Lattner
e11dd370ec new testcase
llvm-svn: 38741
2006-07-19 08:01:28 +00:00
Chris Lattner
85c0e4d780 new testcase
llvm-svn: 38739
2006-07-19 06:40:07 +00:00
Chris Lattner
b563379d78 Make this testcase more interesting, actually add a RUN line.
llvm-svn: 38738
2006-07-19 06:34:41 +00:00
Chris Lattner
a7e2e74cef Avoid testing / ## * in the lexer. This will cause an unhelpful error message
to be emitted from the lexer.  This fixes macro_paste_c_block_comment.c

llvm-svn: 38737
2006-07-19 06:32:35 +00:00
Chris Lattner
30a2fa14ae Move LexingRawMode handling of file EOF out of the preprocessor into the
lexer.  This makes more logical sense and also unbreaks the case when the
lexer hasn't been pushed onto the PP include stack.  This is the case when
pasting identifiers.  This patch implements macro_paste_bcpl_comment.c.

llvm-svn: 38736
2006-07-19 06:31:49 +00:00