Граф коммитов

53 Коммитов

Автор SHA1 Сообщение Дата
Nuno Lopes 6e8c7acb61 cleanup parsing of MS integer suffixes a little. this fixes PR5616
btw, I believe that isMicrosoftInteger can go away; it's not read anywhere

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90036 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-28 13:37:52 +00:00
Daniel Dunbar 23afaad895 Don't #include <stdio.h> when tests don't need it, or use clang instead of clang-cc when they do.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89070 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 08:57:36 +00:00
Daniel Dunbar 4fcfde4d5c Eliminate &&s in tests.
- 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86430 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 01:45:36 +00:00
John McCall d8ac05753d Reorganize the parsing of decl groups / function definitions so that
declarators are parsed primarily within a single function (at least for
these cases).  Remove some excess diagnostics arising during parse failures.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85924 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 19:26:08 +00:00
John Thompson 5e517c85b2 Converted to use FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84005 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 18:51:26 +00:00
Mike Stump 1eb4433ac4 Remove tabs, and whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 15:08:12 +00:00
Daniel Dunbar 025f80dfc2 MultiTestRunner: Validate '&&' at the end of RUN lines.
- This is just to normalize, these will go away soon hopefully.

Added all the missing '&&'s that have crept in. :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77062 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 11:27:37 +00:00
Eli Friedman 8849f11903 PR4395: Don't detect token concatenation in C mode for
C++-specific tokens.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73408 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 19:48:50 +00:00
Eli Friedman 3c54801fbc PR4353: Add support for \E as a character escape.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73153 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-10 01:32:39 +00:00
Chris Lattner e8fa06e073 accept "#pragma clang foo" where we accept "#pragma GCC foo".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71572 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-12 18:21:11 +00:00
Chris Lattner e3ad881e4e Implement -Wfour-char-constants, which is an extension, not an extwarn,
and apparently not part of -Wall


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70329 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 21:51:46 +00:00
Chris Lattner b77f41e66f implement -Wmultichar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70315 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 18:52:02 +00:00
Chris Lattner 2dec3a1aa1 merge number.c into constants.c and start running it in -verify mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70310 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 18:43:12 +00:00
Chris Lattner c1f9d828c7 implement the microsoft/gnu "__COUNTER__" macro: rdar://4329310
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68933 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 01:29:17 +00:00
Chris Lattner c199ab3ea1 Implement the first set of changes for PR3963 and rdar://6759604,
which tries to do better error recovery when it is "obvious" that an
identifier is a mis-typed typename.  In this case, we try to parse
it as a typename instead of as the identifier in a declarator, which
gives us several options for better error recovery and immediately
makes diagnostics more useful.  For example, we now produce:

t.c:4:8: error: unknown type name 'foo_t'
static foo_t a = 4;
       ^

instead of:

t.c:4:14: error: invalid token after top level declarator
static foo_t a = 4;
             ^

Also, since we now parse "a" correctly, we make a decl for it,
preventing later uses of 'a' from emitting things like:

t.c:12:20: error: use of undeclared identifier 'a'
int bar() { return a + b; }
                   ^

I'd really appreciate any scrutiny possible on this, it 
is a tricky area.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68911 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-12 20:42:31 +00:00
Chris Lattner ead616c5d8 fix rdar://6757323, where an escaped newline in a // comment
was causing the char after the newline to get eaten.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68430 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-05 00:26:41 +00:00
Mike Stump 81048aa3e5 Move the rest of the fixit tests to the FixIt area.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68349 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-02 23:44:32 +00:00
Mike Stump 8e7ec66b16 Update wording.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68347 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-02 23:42:13 +00:00
Mike Stump 20d0ee5d23 A code modification hint for files that don't end in a newline.
Eventually, would be nice to be able to run these modifications even
when we don't want the warning or errors for the actual diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68272 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-02 02:29:42 +00:00
Daniel Dunbar d7d5f0223b Rename clang to clang-cc.
Tests and drivers updated, still need to shuffle dirs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67602 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-24 02:24:46 +00:00
Eli Friedman 1ab10d45bf Don't use &> in tests; dash doesn't understand it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67483 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-22 21:49:20 +00:00
Daniel Dunbar 99c7622d1f Fix -E mismatch; an identifier followed by a numeric constant does not
require a space (to avoid concatenation) if the numeric constant had a
leading period.
 - PR3819.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67163 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-18 03:32:24 +00:00
Daniel Dunbar 85c491064b Don't accept '$' in identifiers in assembler-with-cpp mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67013 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-15 00:11:28 +00:00
Chris Lattner 9d4857d191 this test isn't testing anything.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66389 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-08 20:12:34 +00:00
Chris Lattner 51a75d0cc7 change a diagnostic message from something pedantically correct but
useless to something more vague but hopefully more clear.
rdar://6624173


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65639 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-27 17:15:01 +00:00
Chris Lattner 8402c73dd8 Fix PR2477 - clang misparses "//*" in C89 mode
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62368 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 22:39:25 +00:00
Chris Lattner bc3e984221 rdar://6060752 - don't warn about trigraphs in bcpl-style comments
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60942 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-12 07:34:39 +00:00
Chris Lattner c21f1a73b9 split into two tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59770 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 01:04:13 +00:00
Argyrios Kyrtzidis eb83ecde1a Implement support for C++ nested-name-specifiers ('foo::bar::x') in the Parser side.
No Sema functionality change, just the signatures of the Action/Sema methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58913 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 16:45:02 +00:00
Daniel Dunbar 5313ebce37 Test case for previous commit (Workaround gcc bug causing crash on our
preprocessed outputs)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55826 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 03:23:51 +00:00
Ted Kremenek ea644d8440 Following gcc's behavior, only enable trigraphs if '-trigraphs' or '-ansi' is
specified, or -std is set to a conforming mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55738 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-03 21:22:16 +00:00
Eli Friedman 6f7adbdcd0 Fix for PR2750; don't check for an 'e' in the trash after the token.
Note that this isn't really a complete fix; I think there are other 
potential overrun situations.  I don't really know what the best 
systematic fix is, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55622 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-02 05:29:22 +00:00
Chris Lattner 806c3b9478 update this testcase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54037 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25 18:42:46 +00:00
Daniel Dunbar 4f97e019ba Add test case for hex floating point constants in < C99 mode
- For: rdar://6096838


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54036 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25 18:41:57 +00:00
Chris Lattner b081a350b5 Fix PR2252: don't warn on negating an unsigned value ever, and don't emit
'integer constant is so large that it is unsigned' warning for hex literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53070 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-03 03:47:30 +00:00
Chris Lattner 413d355e38 Fix a bug reported by Kelly Wilson, where we incorrectly
rejected FP immediates like 08.123


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52890 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 06:44:49 +00:00
Argyrios Kyrtzidis c577a0e9bf Multiple tests in a single test file must be linked with '&&'.
Otherwise, failing tests other than the last one will not be reported.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52231 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-12 12:40:02 +00:00
Eli Friedman 8891184b23 Fix the run line for this test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52169 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-10 05:18:06 +00:00
Eli Friedman e3eac778a7 Make this test C instead of C++; making it C++ causes a failure on Linux
because clang can't parse stdio.h in C++ mode yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52168 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-10 05:14:31 +00:00
Nuno Lopes 0049db6ce1 fix PR2357 (#ifs didnt invalidate the multiple-inclusion optimization state)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51843 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-01 18:31:24 +00:00
Chris Lattner 146ccd44ec Fix PR2090, a typo in digraph processing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47540 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-24 19:05:57 +00:00
Chris Lattner e66b65c3a3 pull .ll and .bc writing out of the ASTConsumer destructors into some top
level code in clang.  This is a cleanup, but does implement "-o" for 
-emit-llvm.  One effect of this is that "clang foo.c -emit-llvm" will now
emit into foo.ll instead of stdout.  Use "clang foo.c -emit-llvm -o -" or 
"clang < foo.c -emit-llvm" to get the old behavior.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46791 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-06 01:42:25 +00:00
Chris Lattner 2243449253 Add support for #pragma mark, which shouldn't warn about bogus tokens.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45212 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19 19:38:36 +00:00
Christopher Lamb fbd91735c8 Doh! Check in this long overdue test fix.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44450 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 06:35:48 +00:00
Christopher Lamb 016765e345 Support floating point literals of the form "1e-16f" which specify an exponent but no decimal point.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44431 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29 06:06:27 +00:00
Bill Wendling f5f20bdf91 The checking for the delimiters of expected error/warning messages was
looking only for { and } instead of {{ and }}. Changed it to check for
this explicitly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44326 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-26 08:26:20 +00:00
Chris Lattner 921e9ff030 Fix a bug handling hex floats in c90 mode, pointed out by Neil.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44120 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14 16:14:50 +00:00
Chris Lattner 3b427b3ba5 rename -parse-ast-print to -ast-print
rename -parse-ast-dump to -ast-dump
remove -parse-ast, which is redundant with -fsyntax-only



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42852 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 00:18:28 +00:00
Ted Kremenek 9f3d942e99 Removed option "-parse-ast-check" from clang driver. This is now implemented
using "-parse-ast -verify".

Updated all test cases (using a sed script) that invoked -parse-ast-check to
now use -parse-ast -verify.

Fixed a bug where using "-verify" instead of "-parse-ast-check" would not
correctly create the DiagClient needed to accumulate diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42365 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26 20:14:22 +00:00
Chris Lattner 8146b6851e Fix a lexer bug where we incorrectly rejected
int i = /*/ */ 1;

Thanks to Neil for pointing this out.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40379 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-21 23:43:37 +00:00