summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor
Commit message (Collapse)AuthorAgeFilesLines
* MIPS: Move tests check float ABI macros definitions to the more appropriate ↵Simon Atanasyan2012-04-061-0/+17
| | | | | | place. llvm-svn: 154184
* MIPS: Add tests for predefined macros for MIPS targets.Simon Atanasyan2012-04-061-0/+439
| | | | llvm-svn: 154168
* [Lex] Add support for 'user specified system frameworks' (see test case).Daniel Dunbar2012-04-054-0/+17
| | | | | | - Developers of system frameworks need a way for their framework to be treated as a "system framework" during development. Otherwise, they are unable to properly test how their framework behaves when installed because of the semantic changes (in warning behavior) applied to system frameworks. llvm-svn: 154105
* [preprocessor] In Preprocessor::CachingLex() check whether there were more ↵Argyrios Kyrtzidis2012-04-041-1/+1
| | | | | | | | | | | | | tokens cached during the non-cached lex, otherwise we are going to drop them. Fixes a bogus "_Pragma takes a parenthesized string literal" error when expanding consecutive _Pragmas in a macro argument. Part of rdar://11168596 llvm-svn: 153994
* Correct handling of _Pragma macro inside a macro argument.Argyrios Kyrtzidis2012-04-031-0/+35
| | | | | | | | | | | | | | | | If we are pre-expanding a macro argument don't actually "activate" the pragma at that point, activate the pragma whenever we encounter it again in the token stream. This ensures that we will activate it in the correct location or that we will ignore it if it never enters the token stream, e.g: \#define EMPTY(x) \#define INACTIVE(x) EMPTY(x) INACTIVE(_Pragma("clang diagnostic ignored \"-Wconversion\"")) This also fixes the crash in rdar://11168596. llvm-svn: 153959
* [preprocessor] Handle correctly inclusion directives that have macro ↵Argyrios Kyrtzidis2012-03-272-4/+9
| | | | | | | | | | | | | | | | | | expansions, e.g "#include MACRO(STUFF)". -As an inclusion position for the included file, use the file location of the file where it was included but *after* the macro expansions. We want the macro expansions to be considered as before-in-translation-unit for everything in the included file. -In the preprocessing record take into account that only inclusion directives can be encountered as "out-of-order" (by comparing the start of the range which for inclusions is the hash location) and use binary search if there is an extreme number of macro expansions in the include directive. Fixes rdar://11111779 llvm-svn: 153527
* line endingsMatt Beaumont-Gay2012-03-191-8/+8
| | | | llvm-svn: 153046
* Turns #import in MS Mode into an error.Aaron Ballman2012-03-181-0/+17
| | | | llvm-svn: 153009
* Updated the test so that it checks for ms-compatibility in addition to ↵Aaron Ballman2012-03-101-1/+1
| | | | | | ms-extensions. llvm-svn: 152516
* No longer defining GNUC mode when compiling for Microsoft compatibility. ↵Aaron Ballman2012-03-101-0/+1
| | | | | | This allows people's cross-platform compiler-specific macros to work properly. llvm-svn: 152512
* Adding support for #pragma include_alias in MS compatibility mode. This ↵Aaron Ballman2012-03-021-0/+43
| | | | | | implements PR 10705. llvm-svn: 151949
* Fix an ABI problem with ptrdiff_t and intptr_t on PPC32Hal Finkel2012-03-021-2/+2
| | | | | | | | | | ptrdiff_t on PPC32 on Linux, etc. should be int not long. This does not matter for C, but it does matter for C++ because of name mangling. The preprocessor test has been changed accordingly. llvm-svn: 151935
* Merge __has_attribute tests. Patch by Jonathan Sauer!Jean-Daniel Dupas2012-03-011-9/+21
| | | | llvm-svn: 151819
* Implement double underscore names support in __has_attributeJean-Daniel Dupas2012-03-011-0/+14
| | | | llvm-svn: 151809
* Revert r151800, which was committed without review and has correctness issues.Richard Smith2012-03-011-17/+0
| | | | llvm-svn: 151804
* Implements support for #pragma include_alias in ms compatibility mode. ↵Aaron Ballman2012-03-011-0/+17
| | | | | | Fixes PR10705. llvm-svn: 151800
* Move suport for redefining operator keywords from -fms-extensions to ↵Nico Weber2012-03-011-1/+1
| | | | | | -fms-compatibility. llvm-svn: 151776
* Allow operator keywords to be #defined in ms-ext mode.Nico Weber2012-02-291-0/+179
| | | | | | | | | | | | | | Fixes PR10606. I'm not sure if this is the best way to go about it, but I locally enabled this code path without the msext conditional, and all tests pass, except for test/Preprocessor/cxx_oper_keyword.cpp which explicitly checks that operator keywords can't be redefined. I also parsed chromium/win with a clang with and without this patch. It introduced no new errors, but removes 43 existing errors. llvm-svn: 151768
* Accept __has_feature(__feature__) as a synonym for __has_feature(feature) (andRichard Smith2012-02-251-1/+3
| | | | | | likewise for __has_extension). Patch by Jonathan Sauer! llvm-svn: 151445
* Per discussion on cfe-dev, remove '#error' and '#warning' from diagnostic text.Ted Kremenek2012-02-021-2/+2
| | | | llvm-svn: 149566
* Fix "long double" and __SIZE_TYPE__ on powerpc, now with test fix.Nico Weber2012-01-311-20/+225
| | | | | | Fixes PR11867. Patch from Jeremy Huddleston! llvm-svn: 149334
* rename -ccc-host-triple into -targetSebastian Pop2012-01-202-8/+6
| | | | llvm-svn: 148582
* Revert r148138; it's causing test failures.Eli Friedman2012-01-132-6/+8
| | | | llvm-svn: 148141
* rename -ccc-host-triple into -targetSebastian Pop2012-01-132-8/+6
| | | | llvm-svn: 148138
* C11 allows typedefs to be redefined. Implement this in C11 mode, andDouglas Gregor2012-01-111-2/+2
| | | | | | | downgrade the default-error warning to an ExtWarn in C90/99. <rdar://problem/10668057> llvm-svn: 147925
* Added testcases for -Wdisabled-macro-expansion.Abramo Bagnara2012-01-031-0/+27
| | | | llvm-svn: 147473
* Teach the frontend to provide the builtin preprocessor defines forChandler Carruth2012-01-031-12/+14
| | | | | | -ffast-math. llvm-svn: 147440
* Add a target hook for FLT_EVAL_METHOD and use it to set the value on x86 ↵Benjamin Kramer2011-12-281-2/+2
| | | | | | | | | with sse disabled. x87 math evaluates everything with 80 bits precision, so we have to set FLT_EVAL_METHOD to "2". llvm-svn: 147311
* Don't allow #include (and its friends #import, #include_next andRichard Smith2011-12-162-0/+29
| | | | | | | | #__include_macros) in the arguments of a function-style macro. Directives in the arguments of such macros have undefined behaviour, and GCC does not correctly support these cases. In some situations, this can lead to better diagnostics. llvm-svn: 146765
* Switch test over to using -verify instead of using grep. PR11552.Eli Friedman2011-12-141-4/+2
| | | | llvm-svn: 146544
* Make our handling of MMX x SSE closer to what gcc does:Rafael Espindola2011-11-271-0/+13
| | | | | | | | * Enabling sse enables mmx. * Disabling (-mno-mmx) mmx, doesn't disable sse (we got this right already). * The order in not important. -msse -mno-mmx is the same as -mno-mmx -msse. llvm-svn: 145194
* Set __OPTIMIZE_SIZE__ on -Os and -Oz. This matches gcc's behaviour on both OS XRafael Espindola2011-11-261-1/+1
| | | | | | and linux. llvm-svn: 145142
* AAPCS compliance - 32-bit wchar_t should be unsigned for both aapcs and ↵James Molloy2011-11-232-4/+4
| | | | | | | | aapcs-linux. Original behaviour of defining wchar_t as signed int has been kept for apcs-gnu as I don't have any spec for this to validate against. llvm-svn: 145102
* Change this test to reflect the state we are moving in. The ClangChandler Carruth2011-11-051-1/+1
| | | | | | | | | | | | | | | | | | | builtin headers are no longer going to receive the old 'implicit extern "C" block' semantics. This hint is actually ignored by both Clang and GCC at this point, and Clang's own builtin headers can simply be changed if there is any issue with this. Clang should be free to include these however it wants, and so shorter and simpler is better. Note: *nothing* is changing about the *system* stddef.h include. That should always have the exact same include semantics, whether with Clang or GCC or any other compiler. Only the compiler-builtin header search path is changing. If anyone knows of some risk that this introduces that I've not thought of, please chime in. So far, only Windows has switched to the Brave New World, but others should be switching soon. llvm-svn: 143806
* Remove more SystemZ (s390) tests.Dan Gohman2011-10-252-199/+0
| | | | llvm-svn: 142883
* Remove the Blackfin backend.Dan Gohman2011-10-252-205/+0
| | | | llvm-svn: 142881
* Update all tests other than Driver/std.cpp to use -std=c++11 rather thanRichard Smith2011-10-131-1/+1
| | | | | | -std=c++0x. Patch by Ahmed Charles! llvm-svn: 141900
* Add test case for __has_warning.Ted Kremenek2011-10-121-0/+19
| | | | llvm-svn: 141806
* Handle the case where preprocessor entities are not received in order,Argyrios Kyrtzidis2011-10-122-0/+10
| | | | | | fixes http://llvm.org/PR11120 llvm-svn: 141788
* Make -fobjc-nonfragile-abi the -cc1 default, since it's theJohn McCall2011-10-024-9/+9
| | | | | | | | | | | | | | | | | | | 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
* Generate tests for all of the x86 SIMD instruction feature setChandler Carruth2011-09-281-0/+244
| | | | | | | | | | | | | | 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
* Add a little banner to this test. This lets my scripts more easilyChandler Carruth2011-09-281-0/+4
| | | | | | | | | | 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
* Fix a think-o on my part that got enshrined in a FIXME by setting up theChandler Carruth2011-09-281-6/+3
| | | | | | __tune_...__ define as well. llvm-svn: 140690
* Teach Clang to reject 32-bit only CPUs when compiling in 64-bit mode.Chandler Carruth2011-09-281-0/+206
| | | | | | Add 64-bit preprocessor macro tests. llvm-svn: 140688
* Begin fixing Clang's predefined macros for various architectures. ThisChandler Carruth2011-09-282-12/+415
| | | | | | | | | | | | | | | | 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
* Only predefine the __EXCEPTIONS macro if C++ exceptions are turned on.Douglas Gregor2011-09-122-1/+16
| | | | | | | Only predefine the OBJC_ZEROCOST_EXCEPTIONS macro if Objective-C exceptions are turned on. Fixes PR10910. llvm-svn: 139496
* Change err_pp_file_not_found back to an Error; when it's a Warning, we ↵Eli Friedman2011-08-302-0/+4
| | | | | | | | 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
* A couple fixes for preprocessor expressions:Eli Friedman2011-08-032-1/+11
| | | | | | | | | | | 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
* Reenable test.Argyrios Kyrtzidis2011-07-111-1/+0
| | | | llvm-svn: 134928
* Add missing header file for the test.Argyrios Kyrtzidis2011-07-111-0/+1
| | | | llvm-svn: 134927
OpenPOWER on IntegriCloud