summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor
Commit message (Collapse)AuthorAgeFilesLines
* AArch64: initial NEON supportTim Northover2013-08-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Ana Pazos - Completed implementation of instruction formats: AdvSIMD three same AdvSIMD modified immediate AdvSIMD scalar pairwise - Completed implementation of instruction classes (some of the instructions in these classes belong to yet unfinished instruction formats): Vector Arithmetic Vector Immediate Vector Pairwise Arithmetic - Initial implementation of instruction formats: AdvSIMD scalar two-reg misc AdvSIMD scalar three same - Intial implementation of instruction class: Scalar Arithmetic - Initial clang changes to support arm v8 intrinsics. Note: no clang changes for scalar intrinsics function name mangling yet. - Comprehensive test cases for added instructions To verify auto codegen, encoding, decoding, diagnosis, intrinsics. llvm-svn: 187568
* [PowerPC] Support powerpc64le as a syntax-checking target.Bill Schmidt2013-07-261-0/+113
| | | | | | | | | | | | | | | | | | | This patch provides basic support for powerpc64le as an LLVM target. However, use of this target will not actually generate little-endian code. Instead, use of the target will cause the correct little-endian built-in defines to be generated, so that code that tests for __LITTLE_ENDIAN__, for example, will be correctly parsed for syntax-only testing. Code generation will otherwise be the same as powerpc64 (big-endian), for now. The patch leaves open the possibility of creating a little-endian PowerPC64 back end, but there is no immediate intent to create such a thing. The new test case variant ensures that correct built-in defines for little-endian code are generated. llvm-svn: 187180
* Add not to a command that is expected to fail.Rafael Espindola2013-07-241-1/+1
| | | | llvm-svn: 187065
* Changed "an macro" to "a macro" in diagnostic note.Richard Trieu2013-07-231-3/+3
| | | | llvm-svn: 186988
* Add new diagnostic messages when too many arguments are presented to aRichard Trieu2013-07-232-2/+185
| | | | | | | | | | | | | function-like macro. Clang will attempt to correct the arguments by detecting braced initializer lists: 1) If possible, suggest parentheses around arguments containing braced lists which will give the proper number of arguments. 2) If a braced list is detected at the start of a macro argument, it cannot be corrected by parentheses. Instead, just point out the location of these braced lists. llvm-svn: 186971
* Don't give # and ## special treatment when in -traditional-cpp mode. Patch byRichard Smith2013-07-091-0/+17
| | | | | | Austin Seipp! llvm-svn: 185896
* Generalize hack allowing 'const' in __has_attribute (etc) to allow any tokenRichard Smith2013-07-091-0/+4
| | | | | | | with identifier info. This covers most identifier-like entities (other than the ISO646 keywords). llvm-svn: 185895
* Add 'not' to commands that are expected to fail.Rafael Espindola2013-07-046-33/+33
| | | | | | | This is at least good documentation, but also opens the possibility of using pipefail. llvm-svn: 185652
* Convert test to FileCheck.Rafael Espindola2013-07-041-27/+27
| | | | llvm-svn: 185645
* Dont define __LONG_DOUBLE_128__ unless LongDoubleWidth is really 128bits width.Roman Divacky2013-07-031-0/+2
| | | | | | It's not the case on ie. FreeBSD. llvm-svn: 185572
* Fix MSP430 builtin types.Anton Korobeynikov2013-07-012-10/+10
| | | | | | Patch by Job Noorman! llvm-svn: 185362
* Match MSVC's handling of commas during macro argument expansionReid Kleckner2013-06-261-0/+12
| | | | | | | | | | | | This allows clang to parse the type_traits header in Visual Studio 2012, which is included widely in practice. This is a rework of r163022 by João Matos. The original patch broke preprocessing of gtest headers, which this patch addresses. Patch by Will Wilson! llvm-svn: 184968
* Fix a couple of PPC predefined macros that I spotted while driving byChandler Carruth2013-06-251-0/+8
| | | | | | | | this code. These aren't technically standard predefines for the platform but apparantly lots of folks use them as they show up within LLVM's own codebase. ;] This may even fix some self host issues w/ the JIT!!! llvm-svn: 184830
* Accept both / and \\ to fix the windows bots.Rafael Espindola2013-06-241-1/+1
| | | | llvm-svn: 184790
* Make sure the assembler-with-cpp hack for "#" works with multiple "#"s inEli Friedman2013-06-181-0/+4
| | | | | | succession. Fixes PR16363. llvm-svn: 184240
* Adding support for MSVC #pragma detect_mismatch functionality by emitting a ↵Aaron Ballman2013-06-041-0/+5
| | | | | | FAILIFMISMATCH linker command into the object file. llvm-svn: 183178
* [Preprocessor] Prevent expansion of y in x ## y when x is emptyArgyrios Kyrtzidis2013-05-251-3/+7
| | | | | | | | | | | | When x is empty, x ## is suppressed, and when y gets expanded, the fact that it follows ## is not available in the macro expansion result. The macro definition can be checked instead, the ## will be available there regardless of what x expands to. Fixes http://llvm.org/PR12767 Patch by Harald van Dijk! llvm-svn: 182699
* OpenBSD/sparc64 uses long long for int64_t and intmax_t.Jakob Stoklund Olesen2013-05-191-0/+6
| | | | | | Other operating systems, including FreeBSD and NetBSD, use long. llvm-svn: 182215
* fix PR 15726: ptrdiff_t should be int on PowerPC DarwinDavid Fang2013-05-161-0/+106
| | | | llvm-svn: 182029
* Use correct types for SPARC v9.Jakob Stoklund Olesen2013-05-151-0/+8
| | | | | | It's an LP64 platform. llvm-svn: 181867
* C++1y: Update __cplusplus to temporary value 201305L to allow detection of ↵Richard Smith2013-05-071-1/+19
| | | | | | | | | provisional C++1y support. Add __has_feature and __has_extension checks for C++1y features (based on the provisional names from the C++ features study group), and update documentation to match. llvm-svn: 181342
* Add SystemZ supportUlrich Weigand2013-05-062-0/+199
| | | | | | | | | | | | | | This patch then adds all the usual platform-specific pieces for SystemZ: driver support, basic target info, register names and constraints, ABI info and vararg support. It also adds new tests to verify pre-defined macros and inline asm, and updates a test for the minimum alignment change. This version of the patch incorporates feedback from reviews by Eric Christopher and John McCall. Thanks to all reviewers! Patch by Richard Sandiford. llvm-svn: 181211
* Add support for -march=btver2.Benjamin Kramer2013-05-031-0/+46
| | | | llvm-svn: 181006
* Make sure we define wchar_t related macros correctly in -fms-extensions mode.Hans Wennborg2013-05-021-1/+15
| | | | | | | | This adds a test to make sure we define _WCHAR_T_DEFINED and _NATIVE_WCHAR_T_DEFINED correctly in the preprocessor, and updates stddef.h to set it when typedeffing wchar_t. llvm-svn: 180918
* [test] add missing header for the test.Argyrios Kyrtzidis2013-04-291-0/+1
| | | | llvm-svn: 180719
* When emitting a preprocessed file with implicit module imports, make sure ↵Argyrios Kyrtzidis2013-04-291-0/+4
| | | | | | | | line directives are emitted in the next line. rdar://13722737 llvm-svn: 180718
* Fix off-by-one error in #pragma clang system_header.Jordan Rose2013-04-171-1/+1
| | | | | | | | | | | The system_header pragma (from GCC) is implemented using line notes in the source manager. However, a line note's line number specifies the number not for the current line, but for the next line. This was making all line numbers appear off by one after the pragma. Reported by Andy Gibbs, uncovered during r179677. llvm-svn: 179709
* Parser support for #pragma clang __debug capturedTareq A. Siraj2013-04-161-0/+13
| | | | | | | | | | | | | | | This patch implements parsing ‘#pragma clang __debug’ as a first step for implementing captured statements. Captured statements are a mechanism for doing outlining in the AST. see http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-January/027540.html. Currently returns StmtEmpty Author: Andy Zhang <andy.zhang@intel.com> Differential Revision: http://llvm-reviews.chandlerc.com/D369 llvm-svn: 179614
* [Mips] Support -mmicromips / -mno-micromips command line options.Simon Atanasyan2013-04-141-0/+10
| | | | llvm-svn: 179489
* [Mips] Follow-up to r179481. Consider "single-float" as a separateSimon Atanasyan2013-04-141-0/+6
| | | | | | independent of float ABI feature in the MipsTargetInfoBase class. llvm-svn: 179486
* Fix failing dependencies-and-pp.c testReid Kleckner2013-04-111-1/+2
| | | | | | | The bots seem to do more line wrapping because they have longer absolute paths. llvm-svn: 179284
* FileCheck-ify more grep tests with quoted double quotesReid Kleckner2013-04-111-6/+10
| | | | | | | | This required some tedious reordering to match clang's order. Presumably these ObjC tests were generated based on llvm-gcc's output ordering. llvm-svn: 179282
* FileCheck-ify some clang grep tests that use double quotesReid Kleckner2013-04-101-1/+2
| | | | | | | The escaping interaction between Python and grep doesn't work on my system. This change fixes the tests for me. llvm-svn: 179214
* [frontend] When preprocessing, turn implicit module imports into @imports.Argyrios Kyrtzidis2013-04-101-0/+11
| | | | | | part of rdar://13610250 llvm-svn: 179144
* Repeat some #line directive tests for the GNU line marker directive.Michael Ilseman2013-04-101-1/+8
| | | | llvm-svn: 179142
* Improve the diagnostics of the number-reading preprocessor directives.Michael Ilseman2013-04-101-1/+2
| | | | | | | | | | | | | | The GNU line marker directive was sharing code with the #line directive, but some of the warnings/errors were reporting as #line directive diagnostics in both cases. Previously: #line 11foo1 ==> "#line directive requires a simple digit sequence" # 11foo1 ==> "#line directive requires a simple digit sequence" Now, we get: #line 11foo1 ==> "#line directive requires a simple digit sequence" # 11foo1 ==> "GNU line marker directive requires a simple digit sequence" llvm-svn: 179139
* AArch64: bring predefines in line with most recent ACLE documentTim Northover2013-04-051-17/+19
| | | | | | | | | | | The prefixes and names used are now identical to 32-bit ARM, which is also expected to remain unchanged. If we made this change after a release, we'd probably have to support both variants for a while, but I think since AArch64 exists only on trunk now, it's acceptable to simply swap them now. llvm-svn: 178870
* Add support for __GCC_HAVE_SYNC_COMPARE_AND_SWAP_{1,2,4,8} on x86.Michael J. Spencer2013-04-041-0/+18
| | | | | | This fixes std::thread with libstdc++. llvm-svn: 178816
* [preprocessor] Allow comparing two macro definitions syntactically instead ↵Argyrios Kyrtzidis2013-04-031-0/+14
| | | | | | | | | | | | | | of only lexically. Syntactically means the function macro parameter names do not need to use the same identifiers in order for the definitions to be considered identical. Syntactic equivalence is a microsoft extension for macro redefinitions and we'll also use this kind of comparison to check for ambiguous macros coming from modules. rdar://13562254 llvm-svn: 178671
* Define __SIZE_MAX__ preprocessor macro.Evgeniy Stepanov2013-03-281-0/+21
| | | | llvm-svn: 178226
* PR15539: Record "evaluating if/elif condition" flag in the right placeDavid Blaikie2013-03-181-0/+9
| | | | | | | The previous implementation missed the case where the elif condition was evaluated from the context of an #ifdef that was false causing PR15539. llvm-svn: 177345
* Preprocessor: don't keep comments under -traditional-cpp.Jordan Rose2013-03-051-0/+6
| | | | | | | | | | | This patch is designed for minimal intrusion into normal preprocessing and compilation; under -E -traditional-cpp, the lexer will still generate tok::comment nodes since it is preserving all whitespace, but the output printer will then throw it away. <rdar://problem/13338680> llvm-svn: 176534
* Preprocessor: don't consider // to be a line comment in -E -std=c89 mode.Jordan Rose2013-03-052-0/+9
| | | | | | | | | | | | | | | | | | | It's beneficial when compiling to treat // as the start of a line comment even in -std=c89 mode, since it's not valid C code (with a few rare exceptions) and is usually intended as such. We emit a pedantic warning and then continue on as if line comments were enabled. This has been our behavior for quite some time. However, people use the preprocessor for things besides C source files. In today's prompting example, the input contains (unquoted) URLs, which contain // but should still be preserved. This change instructs the lexer to treat // as a plain token if Clang is in C90 mode and generating preprocessed output rather than actually compiling. <rdar://problem/13338743> llvm-svn: 176526
* Add a test to make sure __has_include works from inside a macro.Argyrios Kyrtzidis2013-02-271-0/+6
| | | | llvm-svn: 176152
* [preprocessing record] Have the MacroDefinitions map point to the ↵Argyrios Kyrtzidis2013-02-221-0/+6
| | | | | | | | | | MacroDefinition object instead its index in the preprocessed entities vector. This is because the order of the entities in the vector can change in some (uncommon) cases. llvm-svn: 175907
* Preproceessor: fix #if skipping under -traditional-cpp.Jordan Rose2013-02-221-0/+16
| | | | | | | | | | | | When parsing directives within skipped #if blocks, we don't want to retain any whitespace. Previously we were just skipping comments, but it's not possible to skip comments and retain other whitespace. This change matches the usual behavior for parsing directives (i.e. the behavior outside of skipped #if blocks). <rdar://problem/13267695> llvm-svn: 175840
* Preprocessor: preserve whitespace in -traditional-cpp mode.Jordan Rose2013-02-211-2/+54
| | | | | | | | | Note that unlike GNU cpp we currently do not preserve whitespace in macros (even in -traditional-cpp mode). <rdar://problem/12897179> llvm-svn: 175778
* FileCheck'ize testsDmitri Gribenko2013-02-094-9/+16
| | | | llvm-svn: 174815
* FileCheck'ize a testDmitri Gribenko2013-02-091-1/+2
| | | | llvm-svn: 174814
* Properly validate UCNs for C99 and C++03 (both more restrictive than C(++)11).Jordan Rose2013-02-092-0/+146
| | | | | | | | Add warnings under -Wc++11-compat, -Wc++98-compat, and -Wc99-compat when a particular UCN is incompatible with a different standard, and -Wunicode when a UCN refers to a surrogate character in C++03. llvm-svn: 174788
OpenPOWER on IntegriCloud