Nuno Lopes
baa1bc44af
cleanup parsing of MS integer suffixes a little. this fixes PR5616
...
btw, I believe that isMicrosoftInteger can go away; it's not read anywhere
llvm-svn: 90036
2009-11-28 13:37:52 +00:00
Daniel Dunbar
feedba68b5
Don't #include <stdio.h> when tests don't need it, or use clang instead of clang-cc when they do.
...
llvm-svn: 89070
2009-11-17 08:57:36 +00:00
Daniel Dunbar
8b57697954
Eliminate &&s in tests.
...
- 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious.
llvm-svn: 86430
2009-11-08 01:45:36 +00:00
John McCall
d5a36321b9
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.
llvm-svn: 85924
2009-11-03 19:26:08 +00:00
John Thompson
271f1f07bc
Converted to use FileCheck.
...
llvm-svn: 84005
2009-10-13 18:51:26 +00:00
Mike Stump
11289f4280
Remove tabs, and whitespace cleanups.
...
llvm-svn: 81346
2009-09-09 15:08:12 +00:00
Daniel Dunbar
97ea867690
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. :)
llvm-svn: 77062
2009-07-25 11:27:37 +00:00
Eli Friedman
dd2ab963de
PR4395: Don't detect token concatenation in C mode for
...
C++-specific tokens.
llvm-svn: 73408
2009-06-15 19:48:50 +00:00
Eli Friedman
28a00aa646
PR4353: Add support for \E as a character escape.
...
llvm-svn: 73153
2009-06-10 01:32:39 +00:00
Chris Lattner
b61448d490
accept "#pragma clang foo" where we accept "#pragma GCC foo".
...
llvm-svn: 71572
2009-05-12 18:21:11 +00:00
Chris Lattner
8577f62622
Implement -Wfour-char-constants, which is an extension, not an extwarn,
...
and apparently not part of -Wall
llvm-svn: 70329
2009-04-28 21:51:46 +00:00
Chris Lattner
74c95e20af
implement -Wmultichar
...
llvm-svn: 70315
2009-04-28 18:52:02 +00:00
Chris Lattner
0cd56890ef
merge number.c into constants.c and start running it in -verify mode.
...
llvm-svn: 70310
2009-04-28 18:43:12 +00:00
Chris Lattner
0af3ba1748
implement the microsoft/gnu "__COUNTER__" macro: rdar://4329310
...
llvm-svn: 68933
2009-04-13 01:29:17 +00:00
Chris Lattner
6cc055af1d
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.
llvm-svn: 68911
2009-04-12 20:42:31 +00:00
Chris Lattner
ecdaf40c9e
fix rdar://6757323, where an escaped newline in a // comment
...
was causing the char after the newline to get eaten.
llvm-svn: 68430
2009-04-05 00:26:41 +00:00
Mike Stump
898840f98c
Move the rest of the fixit tests to the FixIt area.
...
llvm-svn: 68349
2009-04-02 23:44:32 +00:00
Mike Stump
5230b85fc1
Update wording.
...
llvm-svn: 68347
2009-04-02 23:42:13 +00:00
Mike Stump
0be8875ea4
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.
llvm-svn: 68272
2009-04-02 02:29:42 +00:00
Daniel Dunbar
a45cf5b6b0
Rename clang to clang-cc.
...
Tests and drivers updated, still need to shuffle dirs.
llvm-svn: 67602
2009-03-24 02:24:46 +00:00
Eli Friedman
bae2042bb5
Don't use &> in tests; dash doesn't understand it.
...
llvm-svn: 67483
2009-03-22 21:49:20 +00:00
Daniel Dunbar
dc78bd9f79
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.
llvm-svn: 67163
2009-03-18 03:32:24 +00:00
Daniel Dunbar
36a3e92521
Don't accept '$' in identifiers in assembler-with-cpp mode.
...
llvm-svn: 67013
2009-03-15 00:11:28 +00:00
Chris Lattner
6417fb5bf4
this test isn't testing anything.
...
llvm-svn: 66389
2009-03-08 20:12:34 +00:00
Chris Lattner
7094c15d7e
change a diagnostic message from something pedantically correct but
...
useless to something more vague but hopefully more clear.
rdar://6624173
llvm-svn: 65639
2009-02-27 17:15:01 +00:00
Chris Lattner
5882771102
Fix PR2477 - clang misparses "//*" in C89 mode
...
llvm-svn: 62368
2009-01-16 22:39:25 +00:00
Chris Lattner
e141a9e225
rdar://6060752 - don't warn about trigraphs in bcpl-style comments
...
llvm-svn: 60942
2008-12-12 07:34:39 +00:00
Chris Lattner
1759ea400e
split into two tests.
...
llvm-svn: 59770
2008-11-21 01:04:13 +00:00
Argyrios Kyrtzidis
32a0379575
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.
llvm-svn: 58913
2008-11-08 16:45:02 +00:00
Daniel Dunbar
0335024c4a
Test case for previous commit (Workaround gcc bug causing crash on our
...
preprocessed outputs)
llvm-svn: 55826
2008-09-05 03:23:51 +00:00
Ted Kremenek
b44763456c
Following gcc's behavior, only enable trigraphs if '-trigraphs' or '-ansi' is
...
specified, or -std is set to a conforming mode.
llvm-svn: 55738
2008-09-03 21:22:16 +00:00
Eli Friedman
ee29c9c2fc
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.
llvm-svn: 55622
2008-09-02 05:29:22 +00:00
Chris Lattner
31614aeb0a
update this testcase.
...
llvm-svn: 54037
2008-07-25 18:42:46 +00:00
Daniel Dunbar
c481f72857
Add test case for hex floating point constants in < C99 mode
...
- For: rdar://6096838
llvm-svn: 54036
2008-07-25 18:41:57 +00:00
Chris Lattner
1cb0e61e98
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.
llvm-svn: 53070
2008-07-03 03:47:30 +00:00
Chris Lattner
d68c04f162
Fix a bug reported by Kelly Wilson, where we incorrectly
...
rejected FP immediates like 08.123
llvm-svn: 52890
2008-06-30 06:44:49 +00:00
Argyrios Kyrtzidis
351763e156
Multiple tests in a single test file must be linked with '&&'.
...
Otherwise, failing tests other than the last one will not be reported.
llvm-svn: 52231
2008-06-12 12:40:02 +00:00
Eli Friedman
940a7c0cf8
Fix the run line for this test.
...
llvm-svn: 52169
2008-06-10 05:18:06 +00:00
Eli Friedman
4f64def9ee
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.
llvm-svn: 52168
2008-06-10 05:14:31 +00:00
Nuno Lopes
363212b3fa
fix PR2357 (#ifs didnt invalidate the multiple-inclusion optimization state)
...
llvm-svn: 51843
2008-06-01 18:31:24 +00:00
Chris Lattner
5329e7e5ed
Fix PR2090, a typo in digraph processing.
...
llvm-svn: 47540
2008-02-24 19:05:57 +00:00
Chris Lattner
b5eda6253b
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.
llvm-svn: 46791
2008-02-06 01:42:25 +00:00
Chris Lattner
c238331377
Add support for #pragma mark, which shouldn't warn about bogus tokens.
...
llvm-svn: 45212
2007-12-19 19:38:36 +00:00
Christopher Lamb
0112f62bb9
Doh! Check in this long overdue test fix.
...
llvm-svn: 44450
2007-11-30 06:35:48 +00:00
Christopher Lamb
42e69f219d
Support floating point literals of the form "1e-16f" which specify an exponent but no decimal point.
...
llvm-svn: 44431
2007-11-29 06:06:27 +00:00
Bill Wendling
8da1db4f34
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.
llvm-svn: 44326
2007-11-26 08:26:20 +00:00
Chris Lattner
e6c7a858b0
Fix a bug handling hex floats in c90 mode, pointed out by Neil.
...
llvm-svn: 44120
2007-11-14 16:14:50 +00:00
Chris Lattner
5e4c75f4ef
rename -parse-ast-print to -ast-print
...
rename -parse-ast-dump to -ast-dump
remove -parse-ast, which is redundant with -fsyntax-only
llvm-svn: 42852
2007-10-11 00:18:28 +00:00
Ted Kremenek
0883fd5817
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.
llvm-svn: 42365
2007-09-26 20:14:22 +00:00
Chris Lattner
c850ad6ee1
Fix a lexer bug where we incorrectly rejected
...
int i = /*/ */ 1;
Thanks to Neil for pointing this out.
llvm-svn: 40379
2007-07-21 23:43:37 +00:00
Chris Lattner
bb1b44f004
Make octal constant lexing use AdvanceToTokenCharacter to give more
...
accurate diagnostics. For test/Lexer/comments.c we now emit:
int x = 000000080; /* expected-error {{invalid digit}} */
^
constants.c:7:4: error: invalid digit '8' in octal constant
00080; /* expected-error {{invalid digit}} */
^
The last line is due to an escaped newline. The full line looks like:
int y = 0000\
00080; /* expected-error {{invalid digit}} */
Previously, we emitted:
constants.c:4:9: error: invalid digit '8' in octal constant
int x = 000000080; /* expected-error {{invalid digit}} */
^
constants.c:6:9: error: invalid digit '8' in octal constant
int y = 0000\
^
which isn't too bad, but the new way is better for the user,
regardless of whether there is an escaped newline or not.
All the other lexer-related diagnostics should switch over
to using AdvanceToTokenCharacter where appropriate. Help
wanted :).
This implements test/Lexer/constants.c.
llvm-svn: 39906
2007-07-16 06:55:01 +00:00
Chris Lattner
539007a78a
Add support for C++'0x keywords, patch by Doug Gregor
...
llvm-svn: 39897
2007-07-16 04:18:29 +00:00
Chris Lattner
bdf3f73eeb
fix this test to work with the checker.
...
llvm-svn: 39708
2007-06-28 05:49:50 +00:00
Bill Wendling
764b90ad4e
Submitted by: Bill Wendling
...
- Revert use of -parse-ast-check.
llvm-svn: 39695
2007-06-27 18:13:04 +00:00
Bill Wendling
fdddfc115e
Submitted by: Bill Wendling
...
Reviewed by: Chris Lattner
- Reverted some checks because they're checking the preprocessor output.
llvm-svn: 39687
2007-06-27 07:26:41 +00:00
Bill Wendling
ff1d2c81ba
Submitted by: Bill Wendling
...
- Convert to using the -parse-ast-check method to check warnings and
errors.
llvm-svn: 39680
2007-06-27 04:07:44 +00:00
Chris Lattner
dee9b26fb8
new testcase
...
llvm-svn: 38996
2006-10-17 02:53:13 +00:00
Chris Lattner
032e6170af
new testcase
...
llvm-svn: 38750
2006-07-20 06:06:55 +00:00
Chris Lattner
f69f835398
new testcase
...
llvm-svn: 38704
2006-07-11 05:53:01 +00:00
Chris Lattner
1500881bd9
new testcase
...
llvm-svn: 38544
2006-06-18 07:00:07 +00:00
Chris Lattner
31eef321bf
Initial checkin of testsuite
...
llvm-svn: 38538
2006-06-18 05:42:02 +00:00