Commit Graph

94 Commits

Author SHA1 Message Date
Eli Friedman 3c93e3dae7 Test for PR7888.
llvm-svn: 111545
2010-08-19 19:13:24 +00:00
Daniel Dunbar 15d8830ea6 tests: Make FileCheck version check that preamble isn't longer than we expected.
llvm-svn: 109077
2010-07-22 02:22:24 +00:00
Daniel Dunbar 26d0aa19d4 tests: XFAIL this test on win32, someone else can hunt this one down.
llvm-svn: 109044
2010-07-21 22:09:09 +00:00
Daniel Dunbar cb08212fd5 tests: Use FileCheck instead of external input; I think this test was failing on
Win32 because of line ending differences.

llvm-svn: 109029
2010-07-21 19:40:01 +00:00
Douglas Gregor af82e3510b Introduce a new lexer function to compute the "preamble" of a file,
which is the part of the file that contains all of the initial
comments, includes, and preprocessor directives that occur before any
of the actual code. Added a new -print-preamble cc1 action that is
only used for testing.

llvm-svn: 108913
2010-07-20 20:18:03 +00:00
Douglas Gregor b37b46e488 Complain when string literals are too long for the active language
standard's minimum requirements.

llvm-svn: 108837
2010-07-20 14:33:20 +00:00
Chris Lattner 3e40dd34c4 rename test
llvm-svn: 108622
2010-07-17 16:17:41 +00:00
Chris Lattner ef74e2b2a8 change the 'invalid token after top level declarator' message to be
'expected ';' after top level declarator' which is much less vague.

llvm-svn: 108106
2010-07-11 22:46:04 +00:00
Chris Lattner 86851b8a7a fix PR4499, patch by Kyle Dean!
llvm-svn: 107836
2010-07-07 23:24:27 +00:00
Daniel Dunbar 8452ef0798 tests: Use %clangxx when using driver for C++, in case C++ support is disabled.
llvm-svn: 107153
2010-06-29 16:52:24 +00:00
Benjamin Kramer 9aa0d39443 A bug I've introduced in STDIN handling surfaced a few broken tests, fix them.
Lexer/hexfloat.cpp is now XFAIL'd, I'd appreciate if someone could look into it.

llvm-svn: 106840
2010-06-25 12:48:07 +00:00
Chandler Carruth e039148801 Daniel re-educated me about what Alias does and does not do. Turn that off for
'-fasm' and explicitly map from that flag to -fgnu-keywords in the driver. Turn
off the driver in the lexer test for this madness and add a test to the driver
that the translation actually works.

llvm-svn: 104428
2010-05-22 02:21:53 +00:00
Chris Lattner fd8fb3c4cd Don't warn about use of hex floats in c++ mode by default,
matching G++'s behavior.

Warn when -pedantic or -Wc++-hex-floats is passed, and
don't warn if -pedantic -Wno-c++-hex-floats are both passed.

llvm-svn: 104295
2010-05-20 23:33:51 +00:00
Chris Lattner 467f6bcfe5 robustify the conflict marker stuff. Don't add 7 twice, which would
make it miss (invalid) things like:
<<<<<<<
>>>>>>>

and crash if 

<<<<<<< 

was at the end of the line.  When we find a >>>>>>> that is not at the
end of the line, make sure to reset Pos so we don't crash on something
like:
<<<<<<< >>>>>>>

This isn't worth making testcases for, since each would require a new file.

rdar://7987078 - signal 11 compiling "<<<<<<<<<<"

llvm-svn: 103968
2010-05-17 20:27:25 +00:00
Chris Lattner fb24a3a4ec push some source location information down through the compiler,
into ContentCache::getBuffer.  This allows it to produce 
diagnostics on the broken #include line instead of without a 
location.

llvm-svn: 101939
2010-04-20 20:35:58 +00:00
Chris Lattner 8fbe98b3b6 enhance sourcemgr to detect various UTF BOM's and emit a fatal error
about it instead of producing tons of garbage from the lexer.

It would be even better for sourcemgr to dynamically transcode (e.g.
from UTF16 -> UTF8).

llvm-svn: 101924
2010-04-20 18:14:03 +00:00
Chandler Carruth 5acc7d0e17 Add testcase that I forgot for r101667 for gnu-keywords.
llvm-svn: 101700
2010-04-18 06:12:13 +00:00
John McCall 62abc944d6 At sabre's request, drop the FP bounds diagnostics down to warnings and file
them under -Wbad-literal.  They're still on by default.

llvm-svn: 97284
2010-02-26 23:35:57 +00:00
Fariborz Jahanian 60794cfa27 Fixes test.
llvm-svn: 94236
2010-01-22 22:30:25 +00:00
Fariborz Jahanian 8c6c0b6a1f ui64, etc. are valid VS suffixes.
Fixes radar 7562363.

llvm-svn: 94224
2010-01-22 21:36:53 +00:00
Alexis Hunt 10e2f7264e Update test function names so as not to use potential keywords.
llvm-svn: 93314
2010-01-13 08:58:42 +00:00
Alexis Hunt af4e28d897 Add a bunch more feature-checking macros for C++0x features. Some of these are
disabled with the intent that users can start with them now and not have to change
a thing to have them work when we implement the features.

llvm-svn: 93312
2010-01-13 08:31:49 +00:00
Alexis Hunt 91b78382b5 Do not parse hexadecimal floating point literals in C++0x mode because they are
incompatible with user-defined literals, specifically with the following form:

  0x1p+1

The preprocessing-number token extends only as far as the 'p'; the '+' is not
included. Previously we could get away with this extension as p was an invalid
suffix, but now with user-defined literals, 'p' might well be a valid suffix
and we are forced to consider it as such.

This patch also adds a warning in non-0x C++ modes telling the user that
this extension is incompatible with C++0x that is enabled by default
(previously and with other languages, we warn only with a compliance
option such as -pedantic).

llvm-svn: 93135
2010-01-10 23:37:56 +00:00
Chris Lattner f9895c48fd add a bunch of missing prototypes to tests
llvm-svn: 93072
2010-01-09 20:43:19 +00:00
John McCall 53b93a091e Diagnose out-of-bounds floating-point constants. Fixes rdar://problem/6974641
llvm-svn: 92127
2009-12-24 09:08:04 +00:00
Chris Lattner 3dfff974ec reimplement r90860, fixing a couple of problems:
1. Don't make a copy of LangOptions every time a lexer is created.
2. Don't make CharInfo global mutable state.
3. Fix the implementation to properly treat ^Z as EOF instead of as
   horizontal whitespace, which matches the semantic implemented by VC++.

llvm-svn: 91586
2009-12-17 05:29:40 +00:00
Daniel Dunbar 5618e98f33 Update tests to use %clang instead of 'clang', and forcibly disable use of '
clang ' or ' clang -cc1 ' or ' clang-cc ' in test lines (by substituting them to
garbage).

llvm-svn: 91460
2009-12-15 22:01:24 +00:00
Daniel Dunbar 8fbe78f6fc Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- 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
2009-12-15 20:14:24 +00:00
Chris Lattner 7c027ee4c2 teach clang to recover gracefully from conflict markers left in source
files: PR5238.

llvm-svn: 91270
2009-12-14 06:16:57 +00:00
Steve Naroff 04bc01833e Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=80043

llvm-svn: 90860
2009-12-08 16:38:12 +00:00
Ted Kremenek 5ef26fb4fd Add 'has_feature(cxx_exceptions)' to allow code to determine via preprocessor logic if C++ exceptions are enabled.
llvm-svn: 90378
2009-12-03 01:34:15 +00:00
Ted Kremenek c3fe01943f Rename has_feature(rtti) to has_feature(cxx_rtti) for clarity.
llvm-svn: 90376
2009-12-03 01:31:28 +00:00
Ted Kremenek 7dac00b2e8 Add FileCheck test for '__has_feature(rtti)'.
llvm-svn: 90373
2009-12-03 01:17:43 +00:00
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