Ted Kremenek
c85a47724d
Add test case for __has_warning.
...
llvm-svn: 141806
2011-10-12 20:06:09 +00:00
Argyrios Kyrtzidis
f37d0a61c0
Handle the case where preprocessor entities are not received in order,
...
fixes http://llvm.org/PR11120
llvm-svn: 141788
2011-10-12 17:36:33 +00:00
John McCall
9b0a7cea0f
Make -fobjc-nonfragile-abi the -cc1 default, since it's the
...
increasingly prevailing case to the point that new features
like ARC don't even support the fragile ABI anymore.
This required a little bit of reshuffling with exceptions
because a check was assuming that ObjCNonFragileABI was
only being set in ObjC mode, and that's actually a bit
obnoxious to do.
Most, though, it involved a perl script to translate a ton
of test cases.
Mostly no functionality change for driver users, although
there are corner cases with disabling language-specific
exceptions that we should handle more correctly now.
llvm-svn: 140957
2011-10-02 01:16:38 +00:00
Chandler Carruth
cd99bad4ac
Generate tests for all of the x86 SIMD instruction feature set
...
predefines based on the output of GCC as well as the CPU predefines.
Invert tests for __AVX__, Clang's AVX feature is hard coded off still.
Switch Atom from 'SSE3' to 'SSSE3'. This matches GCC's behavior, Intel's
documentation, and ICC's documentation (such as I could dig up).
Switch Athlon and Geode to enable 3dnowa rather than just 3dnow and
nothing (resp.).
llvm-svn: 140692
2011-09-28 10:36:46 +00:00
Chandler Carruth
e83c3d9d33
Add a little banner to this test. This lets my scripts more easily
...
automate the process of updating and generating these tests.
If anyone is really interested, I can check my scripts for generating
this test in, but its a horrible pile of shell... Not sure its really
worth it.
llvm-svn: 140691
2011-09-28 10:17:41 +00:00
Chandler Carruth
5d0feef373
Fix a think-o on my part that got enshrined in a FIXME by setting up the
...
__tune_...__ define as well.
llvm-svn: 140690
2011-09-28 09:54:11 +00:00
Chandler Carruth
6e20c2bd35
Teach Clang to reject 32-bit only CPUs when compiling in 64-bit mode.
...
Add 64-bit preprocessor macro tests.
llvm-svn: 140688
2011-09-28 09:45:08 +00:00
Chandler Carruth
5ac1e8e6b1
Begin fixing Clang's predefined macros for various architectures. This
...
is *very* much a WIP that I'll be refining over the next several
commits, but I need to get this checkpoint in place for sanity.
This also adds a much more comprehensive test for architecture macros,
which is roughly generated by inspecting the behavior of a trunk build
of GCC. It still requires some massaging, but eventually I'll even check
in the script that generates these so that others can use it to append
more tests for more architectures, etc.
Next up is a bunch of simplification of the Targets.cpp code, followed
by a lot more test cases once we can reject invalid architectures.
llvm-svn: 140673
2011-09-28 02:59:25 +00:00
Douglas Gregor
b63ab9477c
Only predefine the __EXCEPTIONS macro if C++ exceptions are turned on.
...
Only predefine the OBJC_ZEROCOST_EXCEPTIONS macro if Objective-C
exceptions are turned on. Fixes PR10910.
llvm-svn: 139496
2011-09-12 15:17:19 +00:00
Eli Friedman
3781a36238
Change err_pp_file_not_found back to an Error; when it's a Warning, we suppress it in system headers. And it is not a good idea to suppress it in system headers. (This was originally changed in r134996 to implement -MG.)
...
Fixes <rdar://10041960>. And also brings down the number of warnings without a flag by one :)
llvm-svn: 138842
2011-08-30 23:07:51 +00:00
Eli Friedman
b3bfd84ebb
A couple fixes for preprocessor expressions:
...
1. Be more tolerant of comments in -CC (comment-preserving) mode. We were missing a few cases.
2. Make sure to expand the second FOO in "#if defined FOO FOO". (See also
r97253, which addressed the case of "#if defined(FOO FOO".)
Fixes PR10286.
llvm-svn: 136748
2011-08-03 00:04:13 +00:00
Argyrios Kyrtzidis
bf65d2d820
Reenable test.
...
llvm-svn: 134928
2011-07-11 21:58:47 +00:00
Argyrios Kyrtzidis
c645d60f12
Add missing header file for the test.
...
llvm-svn: 134927
2011-07-11 21:58:44 +00:00
Eli Friedman
8532db2ec4
Test is broken; XFAIL it until Argyrios gets a chance to look at it.
...
llvm-svn: 134925
2011-07-11 21:44:14 +00:00
Argyrios Kyrtzidis
2299889f87
Don't warn for unused macro when undef'ing it, if it comes from an included file. rdar://9745065
...
llvm-svn: 134919
2011-07-11 20:39:47 +00:00
NAKAMURA Takumi
1f2aacf276
test/Preprocessor/include-directive2.c: Get rid of using <float.h> to avoid #include_next on mingw.
...
llvm-svn: 134896
2011-07-11 14:53:27 +00:00
Argyrios Kyrtzidis
e245aa2a93
When expanding macro arguments, treat '##' coming from an argument as a normal token.
...
e.g.
#define M(x) A x B
M(##) // should expand to 'A ## B', not 'AB'
llvm-svn: 134588
2011-07-07 03:40:37 +00:00
Douglas Gregor
3bde9b15a1
Copy diagnostic pragmas to the preprocessed output, from Richard Osborne!
...
llvm-svn: 133633
2011-06-22 19:41:48 +00:00
Douglas Gregor
10c1d268ea
Define __cplusplus to 201103L when in (non-GNU) C++0x mode.
...
llvm-svn: 133437
2011-06-20 15:00:58 +00:00
Chris Lattner
848fa212e8
revert r133003 and fix the bug properly: the issue was that ## in a token
...
lexer is not a paste operator, it is a normal token. This fixes a conformance
issue shown here:
http://p99.gforge.inria.fr/c99-conformance/c99-conformance-clang-2.9.html
and it defines away the crash from before.
llvm-svn: 133005
2011-06-14 18:19:37 +00:00
Chris Lattner
07efdfdafa
Fix a crash on the testcase in PR9981 / rdar://9486765.
...
llvm-svn: 133003
2011-06-14 18:12:03 +00:00
Chris Lattner
6804685c43
attempt to fix windows testers, which generate #line by default.
...
llvm-svn: 131882
2011-05-22 23:47:57 +00:00
Chris Lattner
3bdc7679ce
Invoke the FileChanged callback before pushing the linemarker for a system
...
header. Getting it in the wrong order generated incorrect line markers in -E
mode. In the testcase from PR9861 we used to generate:
# 1 "test.c" 2
# 1 "./foobar.h" 1
# 0 "./foobar.h"
# 0 "./foobar.h" 3
# 2 "test.c" 2
now we properly produce:
# 1 "test.c" 2
# 1 "./foobar.h" 1
# 1 "./foobar.h" 3
# 2 "test.c" 2
This fixes PR9861.
llvm-svn: 131871
2011-05-22 22:10:16 +00:00
Argyrios Kyrtzidis
627c14a068
Only ignore extra tokens after #else if we skip it, otherwise warn. Fixes rdar://9475098.
...
llvm-svn: 131788
2011-05-21 04:26:04 +00:00
Eli Friedman
fe0739dffb
Some small improvements to the builtin (-ffreestanding) stdint.h; in
...
particular, make sure to handle WCHAR_MIN correctly.
llvm-svn: 130618
2011-04-30 19:02:59 +00:00
Francois Pichet
84133e41be
Upgrade Microsoft's __int8, __int16, __int32 and __int64 types from builtin defines to real types.
...
Otherwise statements like:
__int64 var = __int64(0);
would be expanded to:
long long var = long long(0);
and fail to compile.
llvm-svn: 130369
2011-04-28 01:59:37 +00:00
Chandler Carruth
30483fb188
Move all of the logic for __DEPRECATED to the driver based on comments
...
from dgregor.
llvm-svn: 130066
2011-04-23 19:48:40 +00:00
Eli Friedman
4547752402
PR9772: Fix the definition of WINT_MIN and WINT_MAX on Linux -ffreestanding.
...
llvm-svn: 129907
2011-04-21 05:45:45 +00:00
Chris Lattner
57540c5be0
fix a bunch of comment typos found by codespell. Patch by
...
Luis Felipe Strano Moraes!
llvm-svn: 129559
2011-04-15 05:22:18 +00:00
Daniel Dunbar
3b17a865bb
Change Clang's __VERSION__ to include the same basic info as in clang -v.
...
- Please never ever ever ever write a tool that sniffs this.
llvm-svn: 128599
2011-03-31 00:53:51 +00:00
Chandler Carruth
33bf3e758d
Diagnose uninitialized uses of a variable within its own initializer.
...
This is basically the same idea as the warning on uninitialized uses of
fields within an initializer list. As such, it is on by default and
under -Wuninitialized.
Original patch by Richard Trieu, with some massaging from me on the
wording and grouping of the diagnostics.
llvm-svn: 128376
2011-03-27 09:46:56 +00:00
Daniel Dunbar
1057f86d0e
Lexer: Add extremely limited support for -traditional-cpp, ignoring BCPL
...
comments.
llvm-svn: 127910
2011-03-18 21:23:38 +00:00
Peter Collingbourne
2f1e36bfd0
Rename tok::eom to tok::eod.
...
The previous name was inaccurate as this token in fact appears at
the end of every preprocessing directive, not just macro definitions.
No functionality change, except for a diagnostic tweak.
llvm-svn: 126631
2011-02-28 02:37:51 +00:00
Peter Collingbourne
3bffa52933
Make LexOnOffSwitch a Preprocessor member function
...
llvm-svn: 125473
2011-02-14 01:42:24 +00:00
Ted Kremenek
e543be3531
Merge -Wuninitialized-experimental into -Wuninitialized.
...
llvm-svn: 124279
2011-01-26 04:49:48 +00:00
Argyrios Kyrtzidis
b495cc1a7b
When redefining a macro don't warn twice if it's not used and don't warn for duplicate
...
definition by command line options. Fixes rdar://8875916.
llvm-svn: 123767
2011-01-18 19:50:15 +00:00
Douglas Gregor
e6d6e51686
wint_t is defined as 'unsigned int' on Linux. Fixes PR8938.
...
llvm-svn: 123320
2011-01-12 21:19:25 +00:00
Chris Lattner
56f64c14b7
fix rdar://8823139, a crash on a comment in a preprocessed .s file
...
that contains the ## operator.
llvm-svn: 122946
2011-01-06 05:01:51 +00:00
Argyrios Kyrtzidis
338f9aaab2
Handle locations coming from macro instantiations properly in SourceManager::isBeforeInTranslationUnit().
...
Fixes rdar://8790245 and http://llvm.org/PR8821 .
llvm-svn: 122536
2010-12-24 02:53:53 +00:00
Argyrios Kyrtzidis
1cb0de1d4c
Fix diagnostic pragmas.
...
Diagnostic pragmas are broken because we don't keep track of the diagnostic state changes and we only check the current/latest state.
Problems manifest if a diagnostic is emitted for a source line that has different diagnostic state than the current state; this can affect
a lot of places, like C++ inline methods, template instantiations, the lexer, etc.
Fix the issue by having the Diagnostic object keep track of the source location of the pragmas so that it is able to know what is the diagnostic state at any given source location.
Fixes rdar://8365684.
llvm-svn: 121873
2010-12-15 18:44:22 +00:00
Chandler Carruth
b19289331d
This really seems like a boring set of fixes to our tests to make them more
...
independent of the underlying system. Let me know if any of these are too
aggressive.
llvm-svn: 119345
2010-11-16 10:26:08 +00:00
John McCall
18a2c2c0b9
Split out -Wconversion warnings about constant precision into their
...
own subcategory, -Wconstant-conversion, which is on by default.
Tweak the constant folder to give better results in the invalid
case of a negative shift amount.
Implements rdar://problem/6792488
llvm-svn: 118636
2010-11-09 22:22:12 +00:00
Michael J. Spencer
cac9df3bf6
Add test for Windows predefined macros.
...
llvm-svn: 117000
2010-10-21 05:23:48 +00:00
Ted Kremenek
2c8028bcf4
In ~Preprocessor(), also cleanup the MacroInfo objects left-over from stray "#pragma push_macro" uses. This
...
fixes a potential memory leak.
llvm-svn: 116826
2010-10-19 17:40:53 +00:00
Chris Lattner
a09e8efd1f
Per discussion with Sanjiv, remove the PIC16 target from mainline. When/if
...
it comes back, it will be largely a rewrite, so keeping the old codebase
in tree isn't helping anyone.
llvm-svn: 116191
2010-10-11 05:44:49 +00:00
Argyrios Kyrtzidis
40cec8326c
Revert r114316, -Wunused-value enabled by default was intended.
...
llvm-svn: 114318
2010-09-19 23:03:35 +00:00
Argyrios Kyrtzidis
3698bf1c6d
Make -Wunused-value off by default, matching GCC. Fixes rdar://7126194.
...
llvm-svn: 114316
2010-09-19 21:21:44 +00:00
Daniel Dunbar
7eba1bf0b7
Fix this test to use -cc1.
...
llvm-svn: 114156
2010-09-17 02:47:35 +00:00
Ted Kremenek
6174ca456f
Handle '#line' in '-E' that has an empty file name. Fixes <rdar://problem/8439412>.
...
llvm-svn: 114142
2010-09-17 00:41:18 +00:00
Daniel Dunbar
53c9ac30f9
tests: Use -ffreestanding when including stdint.h, to avoid platform dependencies.
...
llvm-svn: 113301
2010-09-07 22:54:28 +00:00
Douglas Gregor
3cc2648b47
Now that GCC will have #pragma push/pop (in GCC 4.6), allow the
...
#pragma without requiring it to be in the "clang" namespace, from
Louis Gerbarg!
llvm-svn: 112484
2010-08-30 15:15:34 +00:00
John McCall
89e925d78e
Add support for Microsoft's __pragma in the preprocessor.
...
Patch by Francois Pichet!
llvm-svn: 112391
2010-08-28 22:34:47 +00:00
Chris Lattner
fee309467b
filecheckize test
...
llvm-svn: 111702
2010-08-21 00:29:50 +00:00
Chris Lattner
20a2b46ca2
fix PR7943, a corner case with the GNU __VA_ARGS__ comma
...
swallowing extension.
llvm-svn: 111701
2010-08-21 00:27:00 +00:00
Chris Lattner
c0a585d63c
Implement #pragma push_macro, patch by Francois Pichet!
...
llvm-svn: 111234
2010-08-17 15:55:45 +00:00
Benjamin Kramer
d05f31d059
Push location through the MacroUndefined PPCallback and use it to print #undefs in -dD mode. (PR7818)
...
llvm-svn: 110523
2010-08-07 22:27:00 +00:00
Douglas Gregor
7617cb8440
Define _INTEGRAL_MAX_BITS for the win32 and win64 targets, from Per Lindén!
...
llvm-svn: 110442
2010-08-06 12:37:52 +00:00
Eli Friedman
865afc96f7
PR7795: Fix the definition of __WCHAR_MAX__ with -fshort-wchar.
...
llvm-svn: 110126
2010-08-03 17:34:19 +00:00
Chris Lattner
52c00bdd5b
Add another terrible VC++ compatibility hack: allow users to
...
allow invalid token pastes (when in -fms-extensions mode)
with -Wno-invalid-token-paste
llvm-svn: 108624
2010-07-17 16:24:30 +00:00
Chris Lattner
b2c4937ee4
rename test
...
llvm-svn: 108623
2010-07-17 16:18:46 +00:00
Daniel Dunbar
120a1e9d0f
Headers: Define __INT64_TYPE__ in terms of getInt64Type(), which isn't always
...
'long'. The practical upshot is so that the uint64_t we define in our stdint.h
ends up being compatible with that defined by gcc (at least on Darwin), which
otherwise could lead to type incompatibilities with other system headers.
llvm-svn: 107255
2010-06-30 06:30:56 +00:00
Daniel Dunbar
540e8b1dcd
Headers: Change [u]intmax_t to be defined in terms of __[U]INTMAX_TYPE__, instead of intN_t.
...
llvm-svn: 107254
2010-06-30 06:30:50 +00:00
Daniel Dunbar
d7e887fb7f
clang: Derive version name from LLVM unless specified explicitly. This means
...
clang is now clang 2.8.
llvm-svn: 106914
2010-06-25 23:34:47 +00:00
Chris Lattner
bc6bcabc61
fix PR7360: -P mode turns off line markers, but not blank space.
...
Apparently some programs which abuse the preprocessor depend
on this.
llvm-svn: 105889
2010-06-12 16:20:56 +00:00
Dan Gohman
04f8720118
Add several more predefines from modern versions of GCC.
...
llvm-svn: 104906
2010-05-28 00:27:15 +00:00
Douglas Gregor
dead00f902
Fix pasto in this test
...
llvm-svn: 102687
2010-04-30 03:07:23 +00:00
Douglas Gregor
6602c25c0c
Add Clang version inspection macros. Fixes PR6681.
...
llvm-svn: 102686
2010-04-30 02:51:06 +00:00
Ted Kremenek
772810137a
Add test case for __has_feature(objc_weak_class).
...
llvm-svn: 102639
2010-04-29 17:43:21 +00:00
Chris Lattner
1cf5bdd03d
emit warn_char_constant_too_large at most once per literal, fixing PR6852
...
llvm-svn: 101580
2010-04-16 23:44:05 +00:00
Douglas Gregor
d2b896ab69
Only predefine the macro _GNU_SOURCE in C++ mode when we're on a
...
platform that typically uses glibc. Fixes a Boost.Thread compilation
failure.
llvm-svn: 101450
2010-04-16 06:31:05 +00:00
Chris Lattner
c745cec17c
Improve line marker directive locations, patch by Jordy Rose
...
llvm-svn: 101226
2010-04-14 04:28:50 +00:00
Chris Lattner
0384e63501
make the token paste avoidance logic turn "..." into ".. ." instead of ". . ."
...
when avoiding paste. Patch by David Peixotto!
llvm-svn: 101218
2010-04-14 03:57:19 +00:00
Chris Lattner
5dbefc6697
make the preprocessor listen to linemarker directives in -E mode,
...
PR6101. This is based on a patch and testcase by Jordy Rose!
llvm-svn: 101097
2010-04-13 00:01:41 +00:00
Chris Lattner
a503f7c9d2
convert to -verify mode.
...
llvm-svn: 100674
2010-04-07 18:43:41 +00:00
Chris Lattner
bf2803fb20
add support for -MQ flag to quote targets in dependency file,
...
PR6661, patch by Ori Avtalion!
llvm-svn: 99821
2010-03-29 17:55:58 +00:00
Chris Lattner
8c5d05a299
fix a case where macro expansion should be disabled, patch by
...
Abramo Bagnara!
llvm-svn: 99626
2010-03-26 17:49:16 +00:00
Chris Lattner
cebeab9f8c
merge all the macro disable tests by using filecheck.
...
llvm-svn: 99625
2010-03-26 17:46:33 +00:00
Chris Lattner
80dbccd1bf
fix a bug in paste avoidance which would cause us to accidentally
...
form a >>=. Patch by Abramo Bagnara, testcase by me.
llvm-svn: 99624
2010-03-26 17:10:02 +00:00
Chris Lattner
9c56ec86b2
fix rdar://7683173, rejecting an invalid conditional
...
llvm-svn: 97253
2010-02-26 19:42:53 +00:00
Sanjiv Gupta
ecd2600c52
Re-applying 96173. Looks like finally I got the test case right.
...
llvm-svn: 96321
2010-02-16 03:37:11 +00:00
Sanjiv Gupta
9d23f93d52
reverting back 96242 as it still causes a test failure.
...
llvm-svn: 96244
2010-02-15 18:02:12 +00:00
Sanjiv Gupta
af56d377f1
Re-applying 96173 with corresponding changes in test.
...
llvm-svn: 96242
2010-02-15 17:19:13 +00:00
Chris Lattner
aa1cccbbef
Fix PR6282: the include guard optimization cannot happen if the
...
guard macro is already defined for the first occurrence of the
header. If it is, the body will be skipped and not be properly
analyzed for the include guard optimization.
llvm-svn: 95972
2010-02-12 08:03:27 +00:00
Chris Lattner
fde85356c6
revert my patch for rdar://7520940 that warns when a published header
...
is #included with "foo.h" style syntax instead of framework syntax.
It produced too much noise.
llvm-svn: 94120
2010-01-22 00:14:44 +00:00
Anton Korobeynikov
485810ec0a
Forgot to commit these
...
llvm-svn: 93458
2010-01-14 21:36:52 +00:00
Chris Lattner
e0d2e342b3
try to make this more stable?
...
llvm-svn: 93090
2010-01-10 00:59:17 +00:00
Chris Lattner
062a721c46
add comment to test.
...
llvm-svn: 93085
2010-01-10 00:36:16 +00:00
Chris Lattner
2ceb625f59
implement rdar://7520940: published framework headers should
...
import other headers within the same framework with the full
framework path, not with a relative include.
llvm-svn: 93083
2010-01-10 00:24:58 +00:00
Daniel Dunbar
0def3d17cb
ARM: Honor -mfpu= and set __VFP_FP__ and __ARM_NEON__ "correctly".
...
- Correctly is in quotes, because we are following what I interpreted as GCC's
intent (which diverges from practice, naturally).
- Also, fix the arch define for arm1136jf-s.
llvm-svn: 91855
2009-12-21 23:28:17 +00:00
Chris Lattner
2fe080c83e
a really old testcase I apparently forgot to 'svn add'.
...
llvm-svn: 91800
2009-12-20 23:00:15 +00:00
Daniel Dunbar
acde99ea52
ARM: Fix predefines (__ARM_ARCH_..., __REGISTER_PREFIX).
...
- This should be done leveraging the backend, but I'm a little refactored
out. I'll fix it one day, I promise.
llvm-svn: 91700
2009-12-18 18:42:37 +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
Fariborz Jahanian
a01b67d7b0
Make tests use the new clang -cc1 flag.
...
llvm-svn: 91303
2009-12-14 18:00:56 +00:00
Chris Lattner
f290e005e4
this was a couple bugzillas too
...
llvm-svn: 91267
2009-12-14 05:03:13 +00:00
Chris Lattner
4c53c40a4c
fix rdar://7466570 - Be more bug compatible with GCC when it comes to
...
expanding directives withing macro expansions. This is undefined behavior
according to 6.10.3p11, so we might as well be undefined in ways similar to
GCC.
llvm-svn: 91266
2009-12-14 05:00:18 +00:00
Chris Lattner
b8132253c8
filecheckize
...
llvm-svn: 91265
2009-12-14 04:57:53 +00:00
Daniel Dunbar
a8ad0a90fb
Improve test portability; I can't figure out how to get the regexp library to
...
match $ correctly with \r\n, unfortunately.
llvm-svn: 90907
2009-12-09 00:04:46 +00:00
Daniel Dunbar
e74042a8e3
Don't use MS extensions in this test, we expect header include markers.
...
llvm-svn: 90880
2009-12-08 21:40:02 +00:00
Chris Lattner
9dfed9fdb6
fix -dM with variadic macros, PR5699
...
llvm-svn: 90735
2009-12-07 01:58:34 +00:00
Chris Lattner
5a6fb511c7
rename names for consistency
...
llvm-svn: 90734
2009-12-07 01:57:13 +00:00
Chris Lattner
01c73e1b16
filecheckize
...
llvm-svn: 90733
2009-12-07 01:49:36 +00:00
Daniel Dunbar
6c8884ce08
Drop Preprocessor/open-failure test, it breaks running the test suite as root,
...
and I can't figure out how to write it more portably.
llvm-svn: 90705
2009-12-06 10:07:46 +00:00
Daniel Dunbar
58ecb2ab51
Unbreak and add test case for r90276, a situation in which getBuffer is expected to fail.
...
Also, update SourceManager.h doxyments for getBuffer() to reflect reality.
llvm-svn: 90701
2009-12-06 09:19:25 +00:00
Daniel Dunbar
7c71b6b95b
Use '-FOO' 'BAR' instead of '-FOO=BAR' in tests.
...
llvm-svn: 90122
2009-11-30 08:41:04 +00:00
Daniel Dunbar
4e7596cc3a
Normalize options to use '-FOO' instead of '--FOO'.
...
llvm-svn: 90071
2009-11-29 09:33:10 +00:00
Daniel Dunbar
f4a72b06c2
Use '-x' 'foo' instead of '-x=foo'.
...
llvm-svn: 90069
2009-11-29 09:32:31 +00:00
Daniel Dunbar
7427fe28dc
Remove unnecessary -fms-extensions=0 from tests (this command line syntax is going away).
...
llvm-svn: 90066
2009-11-29 09:31:53 +00:00
Daniel Dunbar
5fe0866b9d
clang-cc: Change -fsigned-char=0 to -fno-unsigned-char and pass -pic-level using separate args.
...
llvm-svn: 90054
2009-11-29 02:39:08 +00:00
Ken Dyck
adc8511bc8
Define __SIG_ATOMIC_WIDTH__ for use in stdint.h.
...
llvm-svn: 89597
2009-11-22 15:41:04 +00:00
Ken Dyck
33211d9658
Avoid unwanted expansion in macros that paste together INT<n>_C(v) and
...
UINT<n>_C(v) macros.
llvm-svn: 89461
2009-11-20 16:49:10 +00:00
Ken Dyck
8dcc21420b
Avoid unwanted expansion in macros that paste together INT<n>_MIN, INT<n>_MAX,
...
and UINT<n>_MAX defintions.
llvm-svn: 89460
2009-11-20 16:44:38 +00:00
Ken Dyck
764a5f3881
Avoid unwanted macro expansion in macros that paste together int<n>_t and
...
uint<n>_t definitions.
llvm-svn: 89459
2009-11-20 16:37:35 +00:00
Ken Dyck
0138b9e1db
Define __WCHAR_WIDTH__ for use in stdint.h.
...
llvm-svn: 89353
2009-11-19 15:47:58 +00:00
Ken Dyck
f0b343f5b7
Parameterize WINT_MIN and WINT_MAX with __WINT_WIDTH__ to support arbitrary
...
widths. This corrects the values of these definitions for MSP430 and PIC16.
llvm-svn: 89350
2009-11-19 14:35:19 +00:00
Ken Dyck
a1f677c3d1
Add __WINT_WIDTH__ to paramaterize the limits of WINT_MIN and WINT_MAX in
...
stdint.h.
llvm-svn: 89348
2009-11-19 14:16:57 +00:00
Ken Dyck
575128656e
Add __SIZE_WIDTH__ to eventually replace __SIZE_TYPE__ in stdint.h.
...
llvm-svn: 89346
2009-11-19 13:42:09 +00:00
Ken Dyck
9b25f781c5
Restore __INTMAX_TYPE__, __UINTMAX_TYPE__, __PTRDIFF_TYPE__, and
...
__INTPTR_TYPE__ as the last is used in the test/CodeGen/const-init.c and all
could potentially be in use in the wild. My apologies.
llvm-svn: 89345
2009-11-19 13:18:59 +00:00
Ken Dyck
f982fc0b23
Remove __PTRDIFF_TYPE__ as it is no longer needed by stdint.h. It has been
...
replaced with __PTRDIFF_WIDTH__.
llvm-svn: 89344
2009-11-19 12:37:14 +00:00
Ken Dyck
056efe0fc7
Add __PTRDIFF_WIDTH__ macro to eventually replace __PTRDIFF_TYPE__ in stdint.h.
...
llvm-svn: 89342
2009-11-19 12:21:52 +00:00
Ken Dyck
cc11129fda
Remove __INTPTR_TYPE__ as it is no longer needed by stdint.h, which uses
...
__INTPTR_WIDTH__ instead.
llvm-svn: 89340
2009-11-19 12:15:31 +00:00
Ken Dyck
2d4371d666
Define intptr_t and uintptr_t in terms of their equivalent exact-width types.
...
llvm-svn: 89237
2009-11-18 20:24:13 +00:00
Ken Dyck
24cfcf15c3
Predefine __INTPTR_WIDTH__ for future use in stdint.h.
...
llvm-svn: 89231
2009-11-18 20:05:48 +00:00
Ken Dyck
fa01168a5c
Remove the __INTMAX_TYPE__ and __UINTMAX_TYPE__ built-in macros as they are no
...
longer used by stdint.h.
llvm-svn: 89230
2009-11-18 19:51:06 +00:00
Ken Dyck
ac11b7b625
Define INTMAX_C and UINTMAX_C in terms of the corresponding exact-width
...
INTn_C and UINTn_C macros.
llvm-svn: 89226
2009-11-18 19:42:57 +00:00
Ken Dyck
63c8ef8256
Define INTMAX_MIN, INTMAX_MAX, and UINTMAX_MAX in terms of the limit macros for
...
their corresponding exact-width type.
llvm-svn: 89224
2009-11-18 19:22:15 +00:00
Ken Dyck
47181584f1
Define intmax_t and uintmax_t as the [u]intN_t type corresponding to
...
__INTMAX_WIDTH__.
llvm-svn: 89221
2009-11-18 18:57:04 +00:00
Ken Dyck
c0c98291e0
Predefine __INTMAX_WIDTH__ for the future parameterization of INTMAX macros in
...
stdint.h.
llvm-svn: 89203
2009-11-18 13:52:57 +00:00
Ken Dyck
19ac306c2c
Replace (-INT8_C(128)), which uses an illegally out-of-range argument for
...
INT8_C, with (-INT8_C(127)-1) in the definition of INT8_MIN. Apply similar
changes to the definitions of INT16_MIN and INT24_MIN.
llvm-svn: 89120
2009-11-17 18:29:12 +00:00
Ken Dyck
f78dc738a5
Use the INTn_C integer constant macros to generate limit constants with correct
...
suffixes. This corrects the suffixes for the limit constants of the 32-bit
types on MSP430 and PIC16, and the 64-bit types on PPC64, SystemZ, X86_64.
llvm-svn: 89101
2009-11-17 16:26:27 +00:00
Ken Dyck
e115235705
Remove unnecessary parens around the bodies of integer constant macros. C99
...
requires that their arguments be decimal, hex, octal constants---no signs
allowed---making the parens unnecessary.
llvm-svn: 89095
2009-11-17 13:54:02 +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
4656c53e12
Move -fnext-runtime defaulting to driver (and change clang-cc default to
...
-fnext-runtime), instead of using getDefaultLangOptions.
llvm-svn: 89058
2009-11-17 07:07:28 +00:00
Daniel Dunbar
d609b7bbe9
Move char-is-signed defaulting to driver, instead of using
...
getDefaultLangOptions.
llvm-svn: 89053
2009-11-17 06:37:03 +00:00
Ken Dyck
2dc8d5fa3e
Parameterize the constant-generating macros in stdint.h with new built-in
...
__INTn_C_SUFFIX__ macros that are defined for types with corresponding
constant suffixes (i.e. long and long long).
llvm-svn: 88914
2009-11-16 16:36:33 +00:00
Chris Lattner
55c9877b66
Generalize stdint.h for non-8-bit-multiple types, patch by
...
Ken Dyck!
"This adds definitions for types of 8-bit multiples
from 8 to 64 to stdint.h and rationalizes the selection of types
for the exact-width definitions in InitPreprocessor.cpp."
llvm-svn: 86977
2009-11-12 08:08:27 +00:00
Chris Lattner
0fb5bbd401
do not store wchar/char16/char32/intmax width/alignment info
...
into TargetInfo, just derive this based on the underlying type.
This prevents them from getting out of synch, patch by Ken Dyck!
llvm-svn: 86976
2009-11-12 08:04:33 +00:00
Daniel Dunbar
34546ce43d
Remove RUN: true lines.
...
llvm-svn: 86432
2009-11-08 01:47:25 +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
Chris Lattner
e4a8c64731
clean up integer preprocessor type definitions, patch by Ken Dyck!
...
llvm-svn: 86177
2009-11-05 21:21:32 +00:00
Chris Lattner
b0966de585
A simple reordering of the definitions in stdint.h and
...
introduces no new function changes. Patch by Ken Dyck!
llvm-svn: 86062
2009-11-04 23:03:18 +00:00
Chris Lattner
e9d7d78ab3
Implement support for the -undef command line option, patch by
...
Roman Divacky! PR5363
llvm-svn: 85932
2009-11-03 19:50:27 +00:00
John Thompson
616798c31f
Fixed for running on Windows.
...
llvm-svn: 85854
2009-11-03 02:36:47 +00:00
John Thompson
ac0b098d4d
Added __has_include and __has_include_next.
...
llvm-svn: 85834
2009-11-02 22:28:12 +00:00
Chris Lattner
e963d092d8
add two new and very exhaustive preprocessor tests, patch by
...
Ken Dyck!
llvm-svn: 85482
2009-10-29 04:55:36 +00:00
John Thompson
ec87bb5c46
Disabling some MS extensions which cause these tests to fail
...
llvm-svn: 85236
2009-10-27 14:31:53 +00:00
Nuno Lopes
0e86b8675f
fix tests
...
llvm-svn: 85223
2009-10-27 10:09:29 +00:00
Edward O'Callaghan
6d9350b73b
Typo in revision 85201.
...
llvm-svn: 85202
2009-10-27 03:59:44 +00:00
Edward O'Callaghan
7cd5c818da
Convert Preprocessor Clang tests to FileCheck in regards to PR5307.
...
llvm-svn: 85201
2009-10-27 03:47:36 +00:00
Edward O'Callaghan
576a03fed2
Fix a broken test in rev. 85199.
...
llvm-svn: 85200
2009-10-27 03:14:56 +00:00
Edward O'Callaghan
f78edf52de
Convert Preprocessor Clang tests to FileCheck in regards to PR5307.
...
llvm-svn: 85199
2009-10-27 02:36:32 +00:00
Edward O'Callaghan
60c143eff0
Preprocessor tests are whitespace sensitive, as per Revision: 85170 review.
...
llvm-svn: 85194
2009-10-27 01:45:51 +00:00
Edward O'Callaghan
0e2f7930fb
Convert a few tests to FileCheck for PR5307.
...
llvm-svn: 85170
2009-10-26 22:51:02 +00:00
John Thompson
69b4b14f52
Disable Microsoft extensions to fix failure on Windows.
...
llvm-svn: 84893
2009-10-22 20:34:27 +00:00
Mike Stump
11289f4280
Remove tabs, and whitespace cleanups.
...
llvm-svn: 81346
2009-09-09 15:08:12 +00:00
Daniel Dunbar
b1b2016b83
Force triple for this test (non-fragile ABI is default on x86_64-apple-darwin9).
...
llvm-svn: 80645
2009-09-01 00:36:20 +00:00
David Chisnall
4dc74a0d9f
Added test cases for presence and absence of __has_feature(objc_nonfragile_abi) with and without -fobjc-nonfragile-abi.
...
llvm-svn: 80593
2009-08-31 16:53:06 +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
Chris Lattner
fb42a1820f
add push/pop semantics for diagnostics. Patch by Louis Gerbarg!
...
llvm-svn: 75431
2009-07-12 21:18:45 +00:00
Chris Lattner
d9efb6ee52
Fix #pragma GCC system_header by making it insert a virtual linemarker into
...
the file at the point of the pragma. This allows clang to know that all
sourcelocations after the pragma are in a system header.
llvm-svn: 73376
2009-06-15 05:02:34 +00:00
Chris Lattner
2228a1ee61
rename test
...
llvm-svn: 73375
2009-06-15 05:00:02 +00:00
Chris Lattner
77eb1d5333
convert this test to -verify mode.
...
llvm-svn: 73374
2009-06-15 04:59:21 +00:00
Chris Lattner
f2d49da9a8
Fix PR2741 by making our newline tracking be aware of newlines that
...
can occur in the middle of comment tokens.
llvm-svn: 73365
2009-06-15 01:25:23 +00:00
Chris Lattner
15ba94987a
Sink the BuiltinInfo object from ASTContext into the
...
preprocessor and initialize it early in clang-cc. This
ensures that __has_builtin works in all modes, not just
when ASTContext is around.
llvm-svn: 73319
2009-06-14 01:54:56 +00:00
Chris Lattner
b6f77af532
implement and document a new __has_feature and __has_builtin magic
...
builtin preprocessor macro. This appears to work with two caveats:
1) builtins are registered in -E mode, and 2) target-specific builtins
are unconditionally registered even if they aren't supported by the
target (e.g. SSE4 builtin when only SSE1 is enabled).
llvm-svn: 73289
2009-06-13 07:13:28 +00:00
Eli Friedman
fd80b2af16
PR4288: Make -dD (dump macros with preprocessed source) play nicely with
...
# line directives.
llvm-svn: 72724
2009-06-02 07:55:39 +00:00
Eli Friedman
d8cec57b9d
PR4283: Don't truncate multibyte character constants in the
...
preprocessor.
llvm-svn: 72686
2009-06-01 05:25:02 +00:00
Chris Lattner
378d72cc40
update test for r72519
...
llvm-svn: 72520
2009-05-28 05:41:32 +00:00
Eli Friedman
54eb224c3b
Make the bad paste diagnostic print the entire pasted token.
...
llvm-svn: 72497
2009-05-27 22:00:37 +00:00
Chris Lattner
83bd8281e5
Fix a couple of bugs:
...
1. When we accept "#garbage" in asm-with-cpp mode, change the token kind
of the # to unknown so that the preprocessor won't try to process it as
a real #. This fixes a crash on the attached example
2. Fix macro definition extents processing to handle #foo at the end of a
macro to say the definition ends with the foo, not the #.
This is a follow-on fix to r72283, and rdar://6916026
llvm-svn: 72388
2009-05-25 17:16:10 +00:00
Chris Lattner
fc39bccd2b
fix this test to fail when the patch isn't applied.
...
llvm-svn: 72385
2009-05-25 16:14:52 +00:00
Eli Friedman
2d49c4f98d
Make sure an invalid concatentaion doesn't insert whitespace before
...
the RHS. Fixes assembler-with-cpp issue reported on cfe-dev.
llvm-svn: 72370
2009-05-24 19:25:46 +00:00
Daniel Dunbar
0721c2c155
In assembler-with-cpp mode, don't error on '#' (stringize) operator applied to
...
non-argument names, pass the tokens through.
llvm-svn: 72283
2009-05-22 21:35:34 +00:00
Eli Friedman
b529b01985
PR3942: Don't warn on unsigned overflow in preprocessor expressions.
...
llvm-svn: 71960
2009-05-16 21:24:10 +00:00
Chris Lattner
ff96dd0301
Fix rdar://6880630 - # in _Pragma does not start a preprocessor directive.
...
llvm-svn: 71643
2009-05-13 06:10:29 +00:00
Chris Lattner
c898a68998
convert test to use -verify
...
llvm-svn: 71642
2009-05-13 06:07:25 +00:00
Chris Lattner
cfd0fadc75
rename test
...
llvm-svn: 71641
2009-05-13 06:07:04 +00:00
Chris Lattner
f160b5f9e1
When we expect two arguments but have zero, make sure to add
...
two empty arguments. Also, add an assert so that this bug
manifests as an assertion failure, not a valgrind problem.
This fixes rdar://6880648 - [cpp] crash in ArgNeedsPreexpansion
llvm-svn: 71616
2009-05-13 00:55:26 +00:00
Daniel Dunbar
f9d90275f9
Handle -march for the LLVM recognized cpu names.
...
- x86 target feature handling should not be feature complete, even if
the code quality is lacking.
llvm-svn: 71123
2009-05-06 21:56:32 +00:00
Daniel Dunbar
bb36aed06b
More x86 target feature support.
...
- Apologies for the extremely gross code duplication, I want to get
this working and then decide how to get this information out of the
back end.
- This replaces -m[no-]sse4[12] by -m[no-]sse4, it appears gcc
doesn't distinguish them?
- -msse, etc. now properly disable/enable related features.
- Don't always define __SSE3__...
- The main missing functionality bit here is that we don't initialize
the features based on the CPU for all -march options.
llvm-svn: 71117
2009-05-06 21:07:50 +00:00
Eli Friedman
426056acf2
Fix the testcase for PR4132.
...
llvm-svn: 70796
2009-05-03 19:54:21 +00:00
Eli Friedman
2f621b72f4
Fix for PR4132: make sure to insert whitespace consistently before a
...
pasted token.
llvm-svn: 70793
2009-05-03 19:16:00 +00:00
Daniel Dunbar
d58929be46
PR4063, with feeling: Chain PP callbacks by default.
...
- This is somewhat cleaner and also fixes PR4063 for real, I had the
order wrong so we were just creating an empty dependency file.
llvm-svn: 70687
2009-05-03 10:04:17 +00:00
Daniel Dunbar
f6d272f241
PR4063: Fix dependency generation with -E.
...
llvm-svn: 70686
2009-05-03 09:35:25 +00:00
Eli Friedman
2b680b43e9
Simplify the scheme used for keywords, and change the classification
...
scheme to be more useful.
The new scheme introduces a set of categories that should be more
readable, and also reflects what we want to consider as an extension
more accurately. Specifically, it makes the "what is a keyword"
determination accurately reflect whether the keyword is a GNU or
Microsoft extension.
I also introduced separate flags for keyword aliases; this is useful
because the classification of the aliases is mostly unrelated to the
classification of the original keyword.
This patch treats anything that's in the implementation
namespace (prefixed with "__", or "_X" where "X" is any upper-case
letter) as a keyword without marking it as an extension. This is
consistent with the standards in that an implementation is allowed to define
arbitrary extensions in the implementation namespace without violating
the standard. This gets rid of all the nasty "extension used" warnings
for stuff like __attribute__ in -pedantic mode. We still warn for
extensions outside of the the implementation namespace, like typeof.
If someone wants to implement -Wextensions or something like that, we
could add additional information to the keyword table.
This also removes processing for the unused "Boolean" language option;
such an extension isn't supported on any other C implementation, so I
don't see any point to adding it.
The changes to test/CodeGen/inline.c are required because previously, we
weren't actually disabling the "inline" keyword in -std=c89 mode.
I'll remove Boolean and NoExtensions from LangOptions in a follow-up
commit.
llvm-svn: 70281
2009-04-28 03:13:54 +00:00
Chris Lattner
9a84589671
Change our silencing of C typedef redefinition handling to what we had
...
before r69391: typedef redefinition is an error by default, but if
*either* the old or new definition are from a system header, we silence
it.
llvm-svn: 70177
2009-04-27 01:46:12 +00:00
Chris Lattner
35cfb0544a
make -Wtypedef-redefinition an extwarn instead of defaulting
...
to error, doing this breaks too many programs (e.g. Adium).
llvm-svn: 70170
2009-04-27 00:41:01 +00:00
Chris Lattner
40493eb6eb
fix rdar://6816766 - Crash with function-like macro test at end of directive.
...
llvm-svn: 69964
2009-04-24 07:15:46 +00:00
Chris Lattner
ca515ccb49
apply Eli's patch to fix PR4008, with a testcase. Thanks Eli!
...
llvm-svn: 69750
2009-04-21 23:28:41 +00:00
Chris Lattner
f4c68741d4
fix the second half of PR4006 and rdar://6807000 by treating
...
() as being either zero arguments or one empty argument depending
on situation.
llvm-svn: 69627
2009-04-20 21:08:10 +00:00
Chris Lattner
ddddff4f41
Fix PR4007: clang doesn't know -Werror-foo is the same as -Werror=foo
...
llvm-svn: 69557
2009-04-19 22:07:21 +00:00
Chris Lattner
df2226839f
Warn about uses of #pragma STDC FENV_ACCESS ON, since we don't
...
support it. I don't know what evaluation method we use for complex
arithmetic, so I don't know whether/if we should warn about use of
CX_LIMITED_RANGE.
This concludes my planned hacking on STDC pragmas, flame away :)
llvm-svn: 69556
2009-04-19 21:55:32 +00:00
Chris Lattner
02ef4e3dba
diagnose invalid syntax of STDC pragmas.
...
llvm-svn: 69554
2009-04-19 21:50:08 +00:00
Chris Lattner
a0b1f76d10
reject invalid stuff in the STDC namespace.
...
llvm-svn: 69551
2009-04-19 21:25:37 +00:00
Chris Lattner
958ee04368
stub out STDC #pragmas.
...
llvm-svn: 69550
2009-04-19 21:20:35 +00:00
Chris Lattner
21656f22db
basic support for -Wunknown-pragmas, more coming.
...
llvm-svn: 69547
2009-04-19 21:10:26 +00:00
Chris Lattner
1c1a00cf51
move token paste poisoning diagnostics to after the instantiation loc
...
for a token is set, this makes the diagnostic "expanded from stack" work
for this diagnostic. Add a testcase for PR3918.
llvm-svn: 69544
2009-04-19 20:29:42 +00:00
Chris Lattner
db41ddf756
pick a smaller header, one that we control to test this.
...
llvm-svn: 69540
2009-04-19 20:18:57 +00:00
Chris Lattner
1dc5219a0a
rename test for consistency with other pragma test.
...
llvm-svn: 69539
2009-04-19 20:16:27 +00:00
Chris Lattner
0e71dbf9f0
merge pragma poison tests into one file with -verify mode.
...
llvm-svn: 69538
2009-04-19 20:15:59 +00:00
Chris Lattner
ab9d51cfc4
merge two tests
...
llvm-svn: 69537
2009-04-19 20:10:12 +00:00
Chris Lattner
1377dc4c79
convert to -verify mode.
...
llvm-svn: 69532
2009-04-19 18:54:13 +00:00
Chris Lattner
249c38bb02
Fix PR4006, incorrect handling of __VA_ARGS__ when it was the first token
...
in a function-like macro body. This has the added bonus of moving some
function-like macro specific code out of the object-like macro codepath.
llvm-svn: 69530
2009-04-19 18:26:34 +00:00
Chris Lattner
98b100590d
fix rdar://6804322 by wiring up -fdollars-in-identifiers
...
with assembler-with-cpp mode.
llvm-svn: 69520
2009-04-19 07:00:02 +00:00
Chris Lattner
ea73782ce3
convert to -verify mode.
...
llvm-svn: 69518
2009-04-19 06:56:11 +00:00
Chris Lattner
bf78da7b36
Fix PR3917: the location of a #line directive is the location of the first _.
...
llvm-svn: 69485
2009-04-18 22:29:33 +00:00
Chris Lattner
d66f172ab1
more fun with line markers: the digit string is required to be interpreted
...
as decimal, even if it starts with 0. Also, since things like 0x1 are
completely illegal, don't even bother using numericliteralparser for them.
llvm-svn: 69454
2009-04-18 18:35:15 +00:00
Chris Lattner
35dd5056fc
fix PR3927 by being more careful about the pp test for identifier.
...
llvm-svn: 69423
2009-04-18 06:44:18 +00:00
Chris Lattner
5ca5d40cf4
second half of PR3940: #line requires simple digit sequence.
...
llvm-svn: 69422
2009-04-18 06:38:24 +00:00
Chris Lattner
751f045e32
this is really just a recommendation, not a requirement.
...
llvm-svn: 69416
2009-04-18 02:25:14 +00:00
Chris Lattner
2425bcb49a
enforce requirements imposed by C90 6.8 TC1, fixing PR3919.
...
llvm-svn: 69415
2009-04-18 02:23:25 +00:00
Chris Lattner
bc63de144f
Fix PR3938 by taking into account C99 6.10p4.
...
llvm-svn: 69413
2009-04-18 01:34:22 +00:00
Chris Lattner
b547394ba5
convert test to -verify style.
...
llvm-svn: 69412
2009-04-18 01:33:54 +00:00
Chris Lattner
c17925da61
Substantially restructure function-like macro argument parsing.
...
Highlights: PP::isNextPPTokenLParen() no longer eats the (
when present. We now simplify slightly the logic parsing
macro arguments. We now handle PR3937 and other related cases
correctly.
llvm-svn: 69411
2009-04-18 01:13:56 +00:00
Chris Lattner
b40289b2b8
Fix two problems from PR3916, and one problem I noticed while hacking
...
on the code.
llvm-svn: 69404
2009-04-17 23:56:52 +00:00
Chris Lattner
ca556cb3e3
implement PR3940: #line numbers not fully checked
...
llvm-svn: 69403
2009-04-17 23:37:49 +00:00
Chris Lattner
0003c27f5e
#line is allowed to have macros that expand to nothing after them.
...
llvm-svn: 69401
2009-04-17 23:30:53 +00:00
Chris Lattner
2581fc3fa9
tweak redefinition of a typedef a bit to fix a couple of problems:
...
1. We had logic in sema to decide whether or not to emit the error
based on manually checking whether in a system header file.
2. we were allowing redefinitions of typedefs in class scope in C++
if in header file.
3. there was no way to force typedef redefinitions to be accepted
by the C compiler, which annoys me when stripping linemarkers out
of .i files.
The fix is to split the C++ class typedef redefinition path from the
C path, and change the C path to be a warning that normally maps to
error. This causes it to properly be ignored in system headers,
etc. and gives us a way to control it. Passing
-Wtypedef-redefinition now turns the error into a warning.
One behavior change is that we now diagnose cases where you redefine
a typedef in your .c file that was defined in a header file. This
seems like reasonable behavior, and the diagnostic now indicates that
it can be controlled with -Wtypedef-redefinition.
llvm-svn: 69391
2009-04-17 22:04:20 +00:00
Chris Lattner
cac63f359e
Implement support for GCC's -dD mode, which dumps -E output *and*
...
macro definitions.
llvm-svn: 68884
2009-04-12 01:56:53 +00:00
Chris Lattner
feeb8f1316
use doug's new %S thing to make this work when run from different locations.
...
llvm-svn: 68788
2009-04-10 16:51:32 +00:00
Daniel Dunbar
6eaebd0934
Force triple for these tests.
...
llvm-svn: 68651
2009-04-08 23:02:51 +00:00
Chris Lattner
e01d82b81f
finish the implementation of -imacros. The driver still needs to be hooked up.
...
llvm-svn: 68640
2009-04-08 20:53:24 +00:00
Daniel Dunbar
17ddaa677e
More fixes to builtin preprocessor defines.
...
- Add -static-define option driver can use when __STATIC__ should be
defined (instead of __DYNAMIC__).
- Don't set __OPTIMIZE_SIZE__ on Os, __OPTIMIZE_SIZE__ is tied to Oz.
- Set __NO_INLINE__ following GCC 4.2.
- Set __GNU_GNU_INLINE__ or __GNU_STDC_INLINE__ following GCC 4.2.
- Set __EXCEPTIONS for Objective-C NonFragile ABI.
- Set __STRICT_ANSI__ for standard conforming modes.
- I added a clang style test case in utils for this, but its not
particularly portable and I don't think it belongs in the test
suite.
llvm-svn: 68621
2009-04-08 18:03:55 +00:00
Daniel Dunbar
ab7b2f5623
Set __PIC__ (more) correctly.
...
- Add -pic-level clang-cc option to specify the value for the define,
updated driver to pass this.
- Added __pic__
- Added OBJC_ZEROCOST_EXCEPTIONS define while I was here (to match gcc).
llvm-svn: 68584
2009-04-08 03:03:23 +00:00
Anders Carlsson
e871d05e26
Fix broken test case. I have no idea why this ever worked.
...
llvm-svn: 68526
2009-04-07 18:21:53 +00:00
Daniel Dunbar
88056a97f2
Use %s in test, not hard coded name.
...
llvm-svn: 68521
2009-04-07 17:09:43 +00:00
Chris Lattner
0f98a286a3
implement rdar://6762183. I'm not sure if it is more insane that
...
GCC ignores macro definitions after \n's or that real code depends
on this.
llvm-svn: 68511
2009-04-07 06:02:44 +00:00
Anders Carlsson
65cb90efc1
Define __OPTIMIZE__ and __OPTIMIZE_SIZE__ if the -O[12] and -Os flags are passed to the compiler.
...
llvm-svn: 68450
2009-04-06 17:37:10 +00:00
Daniel Dunbar
386ef885bb
Pull clang-cc code for generating PTH files based on the input type.
...
- <rdar://problem/6741594> [pth] don't abuse -x to drive pth
generation
- Simpler, and fixes PR3915.
Cleanup test cases for PTH:
- Update to use -emit-pth
- Removed PTH test of carbon.c and cocoa.mm; these didn't actually
verify anything, and since PTH is token based the extra coverage
(over cocoa.m) isn't particularly helpful.
- Split PTH tests in cocoa.m to cocoa-pth.m, solely to increase
available parallelism when running tests.
Ted, could you update the PTH test cases (include-pth.c and
cocoa-pth.m) to have some sort of positive check that the PTH is
getting used? "# of PTH cache hits" or "tokens read from PTH cache"
statistics would work great. :)
llvm-svn: 68189
2009-04-01 05:09:09 +00:00
Chris Lattner
51a53f92a5
fix PR3880, fixing a comma swallowing bug handling macros that only take
...
... arguments.
llvm-svn: 67706
2009-03-25 21:08:24 +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
Chris Lattner
5030e5eabe
The individual pieces of an invalid paste as still candidates for expansion.
...
This matters in assembler mode, where this is silently allowed.
This fixes rdar://6709206.
llvm-svn: 67539
2009-03-23 17:32:45 +00:00
Ted Kremenek
8b2c1cd5a2
Fix include-pth.c test case to (hopefully) more resilient to where and how tests
...
are executed.
llvm-svn: 67419
2009-03-20 23:45:36 +00:00
Ted Kremenek
4ed32352c9
Add test case for '-include-pth'.
...
llvm-svn: 67386
2009-03-20 17:56:12 +00:00
Chris Lattner
88c347443e
add tests for the various .S bugs I fixed on wednesday.
...
llvm-svn: 67381
2009-03-20 16:28:22 +00:00
Chris Lattner
c4867109f8
rename this test from .S to .c so that it gets run.
...
llvm-svn: 67380
2009-03-20 16:16:49 +00:00
Chris Lattner
794c001ad4
fix PR3764 - A redefinition of a pre-processor macro fails
...
Redefinition checking should ignore the leading whitespace and
start of line flags on the first token of an expansion.
llvm-svn: 66442
2009-03-09 20:33:32 +00:00
Chris Lattner
5c1f4d3c02
convert this to use -verify.
...
llvm-svn: 66441
2009-03-09 20:31:39 +00:00
Chris Lattner
b960cdd255
rename test
...
llvm-svn: 66440
2009-03-09 20:30:53 +00:00
Chris Lattner
d4a96730c1
#import is not considered an extension for ObjC.
...
llvm-svn: 66246
2009-03-06 04:28:03 +00:00
Chris Lattner
2edf0fcb75
fix PR3579: __LINE__ expands to the presumed location of the
...
*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
2009-02-15 21:06:15 +00:00
Chris Lattner
9dc9c206d3
track "just a little more" location information for macro instantiations.
...
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
2009-02-15 20:52:18 +00:00
Mike Stump
6b63074de9
Fix limits.h for linux, as glibc does a #include_next unless
...
_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
2009-02-12 23:06:31 +00:00
Chris Lattner
1630c3c4f0
Add an implementation of -dM that follows GCC closely enough to permit
...
diffing the output of:
clang -dM -o - -E -x c foo.c | sort
llvm-svn: 63926
2009-02-06 06:45:26 +00:00
Chris Lattner
2e731e369c
smaller header.
...
llvm-svn: 63766
2009-02-04 19:47:38 +00:00
Chris Lattner
022923a22a
Fix PR3464 by searching for headers from the predefines
...
buffer as if the #include happened from the main file.
llvm-svn: 63764
2009-02-04 19:45:07 +00:00
Chris Lattner
7ead0396f6
Ok, we need a system header for this test to pass in the clang/test directory as well as from the pp directory.
...
llvm-svn: 63763
2009-02-04 19:44:14 +00:00
Chris Lattner
988dff84f1
fix test
...
llvm-svn: 63762
2009-02-04 19:40:02 +00:00
Chris Lattner
2f7bb79c86
rename again
...
llvm-svn: 63761
2009-02-04 19:38:30 +00:00
Chris Lattner
4a82a24108
rename some tests
...
llvm-svn: 63759
2009-02-04 19:38:12 +00:00