summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor
Commit message (Collapse)AuthorAgeFilesLines
...
* Disable __has_cpp_attribute when not compiling in C++ mode. As this feature ↵Aaron Ballman2015-05-111-1/+4
| | | | | | | | test macro only supports C++ style attributes, it doesn't apply to code compiled as C code, and can lead to diagnostics when given a scoped attribute. This addresses PR23435. llvm-svn: 236996
* [MSVC] Mimic MSVC whitespace collapse for incompatible token pastingWill Wilson2015-04-171-0/+7
| | | | | | | | | | In public MS headers for XAudio, clang would fail to generate a valid UUID due to the UUID components being combined with the '-' UUID separators. Clang would attempting to recover but would preserve the leading whitespace from the tokens after each failed paste leading to spaces creeping into the UUID and causing an error in the __declspace(uuid()) parsing. Reference: Microsoft DirectX SDK (June 2010)\Include\XAudio2.h(51) Resolves http://llvm.org/pr23071 llvm-svn: 235186
* [AArch64] Add v8.1a architectureVladimir Sukharev2015-04-161-0/+8
| | | | | | | | | | | | Add support for AArch64 v8.1 architecture. Briefly it is described on http://community.arm.com/groups/processors/blog/2014/12/02/the-armv8-a-architecture-and-its-ongoing-development Reviewers: jmolloy Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8493 llvm-svn: 235110
* [Mips] Generate warning for invalid '-mnan' and '-march' combinationsPetar Jovanovic2015-04-141-1/+6
| | | | | | | | | | | | This patch generates a warning for invalid combination of '-mnan' and '-march' options, it properly sets NaN encoding for a given '-march', and it passes a proper NaN encoding to the assembler. Patch by Vladimir Radosavljevic. Differential Revision: http://reviews.llvm.org/D8170 llvm-svn: 234882
* [ARM] add support for Cortex-R4/R4FJaved Absar2015-04-091-0/+18
| | | | | | | | Adds ARM Cortex-R4 and R4F support and tests in Clang. Though Cortex-R4 support was present, the support for hwdiv in thumb-mode was not defined or tested properly. This has also been added. llvm-svn: 234488
* Set the type of ptrdiff_t to signed on NVPTX targetsEli Bendersky2015-04-011-3/+3
| | | | | | | It was unsigned before, which is unlike any other target and also doesn't make much sense. llvm-svn: 233836
* Set NVPTX64 target's size_t to match other 64-bit targetsEli Bendersky2015-04-011-8/+8
| | | | llvm-svn: 233830
* [SystemZ] Support transactional execution on zEC12Ulrich Weigand2015-04-011-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The zEC12 provides the transactional-execution facility. This is exposed to users via a set of builtin routines on other compilers. This patch adds clang support to enable those builtins. In partciular, the patch: - enables the transactional-execution feature by default on zEC12 - allows to override presence of that feature via the -mhtm/-mno-htm options - adds a predefined macro __HTM__ if the feature is enabled - adds support for the transactional-execution GCC builtins - adds Sema checking to verify the __builtin_tabort abort code - adds the s390intrin.h header file (for GCC compatibility) - adds s390 sections to the htmintrin.h and htmxlintrin.h header files Since this is first use of target-specific intrinsics on the platform, the patch creates the include/clang/Basic/BuiltinsSystemZ.def file and hooks it up in TargetBuiltins.h and lib/Basic/Targets.cpp. An associated LLVM patch adds the required LLVM IR intrinsics. For reference, the transactional-execution instructions are documented in the z/Architecture Principles of Operation for the zEC12: http://publibfp.boulder.ibm.com/cgi-bin/bookmgr/download/DZ9ZR009.pdf The associated builtins are documented in the GCC manual: http://gcc.gnu.org/onlinedocs/gcc/S_002f390-System-z-Built-in-Functions.html The htmxlintrin.h intrinsics provided for compatibility with the IBM XL compiler are documented in the "z/OS XL C/C++ Programming Guide". llvm-svn: 233804
* [SystemZ] Fix definition of IntMaxType / Int64TypeUlrich Weigand2015-03-302-26/+26
| | | | | | | | Like on other 64-bit platforms, Int64Type should be SignedLong on SystemZ, not SignedLongLong as per default. This could cause ABI incompatibilities in certain cases (e.g. name mangling). llvm-svn: 233544
* [lex] Don't create a garbage token if parsing of __has_include fails.Benjamin Kramer2015-03-291-0/+12
| | | | | | It will crash downstream somewhere. Found by afl-fuzz. llvm-svn: 233493
* Make the msse4/mno-sse4 flags aliases of the maximum sse valuesEric Christopher2015-03-251-0/+4
| | | | | | | | | | | | | they enable/disable. This fixes two things: a) sse4 isn't actually a target feature, don't treat it as one. b) we weren't correctly disabling sse4.1 when we'd pass -mno-sse4 after enabling it, thus passing preprocessor directives and (soon) passing the function attribute as well when we shouldn't. llvm-svn: 233223
* Disable this test for PS4 target because PS4 issues different diagnostics.Yunzhong Gao2015-03-251-0/+1
| | | | llvm-svn: 233210
* Adds a warning for unrecognized argument to #pragma comment() on PS4.Yunzhong Gao2015-03-231-0/+27
| | | | | | | | | | | PS4 target recognizes the #pragma comment() syntax as in -fms-extensions, but only handles the case of #pragma comment(lib). This patch adds a warning if any other arguments are encountered. This patch also refactors the code in ParsePragma.cpp a little bit to make it more obvious that some codes are being shared between -fms-extensions and PS4. llvm-svn: 233015
* Lex: Don't call getIdentifierInfo on annotation tokensDavid Majnemer2015-03-181-0/+8
| | | | | | | | These calls are usually guarded by checks for isAnnotation() but it looks like we missed a spot. This would cause the included test to crash clang. llvm-svn: 232616
* [PowerPC] ABI support for the QPX vector instruction setHal Finkel2015-03-111-0/+1
| | | | | | | | | | | | | | Support for the QPX vector instruction set, used on the IBM BG/Q supercomputer, has recently been added to the LLVM PowerPC backend. This vector instruction set requires some ABI modifications because the ABI on the BG/Q expects <4 x double> vectors to be provided with 32-byte stack alignment, and to be handled as native vector types (similar to how Altivec vectors are handled on mainline PPC systems). I've named this ABI variant elfv1-qpx, have made this the default ABI when QPX is supported, and have updated the ABI handling code to provide QPX vectors with the correct stack alignment and associated register-assignment logic. llvm-svn: 231960
* Add target information for CloudABI on x86-64.Ed Schouten2015-03-111-0/+305
| | | | | | | | | | | CloudABI can be identified by the __CloudABI__ preprocessor definition. The system uses ELF executables. CloudABI uses Unicode 7.0.0 for the encoding of wchar_t. As Unicode 7.0.0 is synchronized with ISO/IEC 10646:2012 (released on 2012-06-01), __STDC_ISO_10646__ is defined as 201206L. llvm-svn: 231912
* Add Clang support for PPC cryptography builtinsNemanja Ivanovic2015-03-041-0/+6
| | | | | | Review: http://reviews.llvm.org/D7951 llvm-svn: 231291
* Add __ARM_DWARF_EH__ to signify the use of Itanium ABI for unwind instructions.Renato Golin2015-02-271-0/+7
| | | | | | | | Equally to NetBSD, Bitrig will be using .eh_frame unwinding on ARM. Patch by Patrick Wildt. llvm-svn: 230763
* AMDGCN: Define cl_khr_fp64 when compiling OpenCL programsTom Stellard2015-02-271-0/+3
| | | | llvm-svn: 230761
* Add -fuse-line-directive flag to control usage of #line with -EReid Kleckner2015-02-261-6/+6
| | | | | | | | | | | | | | | | | | Currently -fms-extensions controls this behavior, which doesn't make much sense. It means we can't identify what is and isn't a system header when compiling our own preprocessed output, because #line doesn't represent this information. If someone is feeding Clang's preprocessed output to another compiler, they can use this flag. Fixes PR20553. Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D5217 llvm-svn: 230587
* Commit patch for PR19649. Set the correct sign of wide character for ↵Michael Wong2015-02-242-0/+12
| | | | | | | | | | literals based on underlying type of wchar_t. Reviewed: http://reviews.llvm.org/D7559 Patch by Rachel Craig; Test cases by Hubert Tong. llvm-svn: 230333
* Add C11 *_DECIMAL_DIG.Ed Schouten2015-02-231-37/+40
| | | | | | | | | | | | | | | Before C11 there was only the DECIMAL_DIG definition. As of C11, we now have one definition per floating point type (e.g. DBL_DECIMAL_DIG). Change the existing code to define the new versions. To remain backward compatible, define __DECIMAL_DIG__ as __LDBL_DECIMAL_DIG__. Also update the tests. It seems that some of the existing test vectors were incorrect. Change all tests for __DECIMAL_DIG__ to expect __LDBL_DECIMAL_DIG__. Add tests for *_DECIMAL_DIG for FreeBSD/amd64, as I happen to have such a system laying around. I've validated that the values are in sync with <float.h>. llvm-svn: 230207
* [Mips] Support mips32r3, mips32r5, mips64r3, mips64r5 MIPS ISA namesSimon Atanasyan2015-02-201-0/+36
| | | | | | | | | The patch teaches the clang's driver to understand new MIPS ISA names, pass appropriate options to the assembler, defines corresponding macros etc http://reviews.llvm.org/D7737 llvm-svn: 230092
* [ARM] Add missing M/R class CPUsBradley Smith2015-02-181-0/+13
| | | | | | | | | | | | Add some of the missing M and R class Cortex CPUs, namely: Cortex-M0+ (called Cortex-M0plus for GCC compatibility) Cortex-M1 SC000 SC300 Cortex-R5 llvm-svn: 229661
* [mips] Partially revert r223927: Removing __SIZEOF_INT128__ macro for MIPS64Vasileios Kalintiris2015-02-121-2/+2
| | | | | | | | Partially revert r223927 because LLVM gained support for 128-bit integers in r227089. Modify and keep the tests that verify the definition of the macro __SIZEOF_INT128__ for MIPS64 BE & LE in the preprocessor. llvm-svn: 228918
* Preprocessor: support __BIGGEST_ALIGNMENT__ macroTim Northover2015-02-061-0/+224
| | | | | | | | | | | For compatibility with GCC (and because it's generally helpful information otherwise inaccessible to the preprocessor). This appears to be canonically the alignment of max_align_t (e.g. on i386, __BIGGEST_ALIGNMENT__ is 4 even though vector types will be given greater alignment). Patch mostly by Mats Petersson llvm-svn: 228367
* Teaches the Clang driver to accept Cortex-A72Renato Golin2015-02-041-0/+2
| | | | | | | | | A previous commit added Cortex-A72 to LLVM, this teaches Clang to accept it as well. Patch by Ranjeet Singh. llvm-svn: 228141
* No longer SCE_PRIVATE ;)Sean Silva2015-01-271-1/+0
| | | | llvm-svn: 227200
* Begin to teach clang about the PS4.Alex Rosenberg2015-01-271-0/+114
| | | | llvm-svn: 227194
* [Mips] Fix type of 64-bit integer in case of MIPS N64 ABISimon Atanasyan2015-01-222-58/+672
| | | | | | Differential Revision: http://reviews.llvm.org/D7127 llvm-svn: 226877
* [Mips] Define macros `__mips_isa_rev` in case of mips32r6/mips64r6 optionsSimon Atanasyan2015-01-151-0/+18
| | | | llvm-svn: 226136
* [multilib] Teach Clang's code about multilib by threadingChandler Carruth2014-12-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a CLANG_LIBDIR_SUFFIX down from the build system and using that as part of the default resource dir computation. Without this, essentially nothing that uses the clang driver works when building clang with a libdir suffix. This is probably the single biggest missing piece of support for multilib as without this people could hack clang to end up installed in the correct location, but it would then fail to find its own basic resources. I know of at least one distro that has some variation on this patch to hack around this; hopefully they'll be able to use the libdir suffix functionality directly as the rest of these bits land. This required fixing a copy of the code to compute Clang's resource directory that is buried inside of the frontend (!!!). It had bitrotted significantly relative to the driver code. I've made it essentially a clone of the driver code in order to keep tests (which use cc1 heavily) passing. This copy should probably just be removed and the frontend taught to always rely on an explicit resource directory from the driver, but that is a much more invasive change for another day. I've also updated one test which actually encoded the resource directory in its checked output to tolerate multilib suffixes. Note that this relies on a prior LLVM commit to add a stub to the autoconf build system for this variable. llvm-svn: 224924
* Lex: Don't let annotation tokens get into macro expansionDavid Majnemer2014-12-281-0/+5
| | | | | | | | | | We'd let annotation tokens from '#pragma pack' and the like get inside a function-like macro. This would lead to terror and mayhem; stop the madness early. This fixes PR22037. llvm-svn: 224896
* Fixed warnings on redefine keywords and reserved ids.Serge Pavlov2014-12-184-19/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | Repared support for warnings -Wkeyword-macro and -Wreserved-id-macro. The warning -Wkeyword-macro now is not issued in patterns that are used in configuration scripts: #define inline also for 'const', 'extern' and 'static'. If macro repalcement is identical to macro name, the warning also is not issued: #define volatile volatile And finally if macro replacement is also a keyword identical to the replaced one but decorated with leading/trailing underscores: #define inline __inline #define inline __inline__ #define inline _inline // in MSVC compatibility mode Warning -Wreserved-id-macro is off by default, it could help catching things like: #undef __cplusplus llvm-svn: 224512
* Move -Wkeyword-macro into -pedantic, remove -Wreserved-id-macro.Nico Weber2014-12-162-14/+14
| | | | | | | | | | | | | | | | | | | As discussed on the post-commit review thread for r224012, -Wkeyword-macro fires mostly on headers trying to set up portable defines and doesn't find much bad stuff in practice. But [macro.names]p2 does disallow defining or undefining keywords, override and final, and alignas, so keep the warning but move it into -pedantic. -Wreserved-id-macro warns on #define __need_size_t which is more or less public api for glibc headers. Since this warning isn't motivated by a standard, remove it. (See also r223114 for a previous follow-up to r224012.) llvm-svn: 224371
* Preprocessor: Recover instead of mutating a token in ExpandBuiltinMacroDavid Majnemer2014-12-151-1/+8
| | | | | | | | | | | We would CreateString on arbitrary garbage instead of just skipping to the end of the builtin macro. Eventually, this would cause us to crash because we would end up replacing the contents of a character token with a numeric literal. This fixes PR21825. llvm-svn: 224238
* Do not warn on keyword undefSerge Pavlov2014-12-122-0/+50
| | | | | | | #undef a keyword is generally harmless but used often in configuration scripts. Also added tests that I forgot to include to commit in r223114. llvm-svn: 224100
* Emit warning if define or undef reserved identifier or keyword.Serge Pavlov2014-12-111-0/+2
| | | | | | Recommit of r223114, reverted in r223120. llvm-svn: 224012
* [mips] Removing __SIZEOF_INT128__ macro for MIPS64Simon Atanasyan2014-12-101-0/+2
| | | | | | | | | | | | | This is a temporary workaround while MIPS64 has not yet fully supported 128-bit integers. But declaration of int128 type is necessary even though `__SIZEOF_INT128__` is undefined because c++ standard header files like `limits` throw error message if `__int128` is not available. Patch by Sagar Thakur. Differential Revision: http://reviews.llvm.org/D6402 llvm-svn: 223927
* Modify __has_attribute so that it only looks for GNU-style attributes. ↵Aaron Ballman2014-12-051-0/+5
| | | | | | Removes the ability to look for generic attributes and keywords via this macro, which has the potential to be a breaking change. However, since there is __has_cpp_attribute and __has_declspec_attribute, and given the limited usefulness of querying a generic attribute name regardless of syntax, this seems like the correct path forward. llvm-svn: 223468
* Added a new preprocessor macro: __has_declspec_attribute. This can be used ↵Aaron Ballman2014-12-051-1/+16
| | | | | | as a way to determine whether Clang supports a __declspec spelling for a given attribute, similar to __has_attribute and __has_cpp_attribute. llvm-svn: 223467
* Reverted r223114, it caused failure on on clang-native-arm-cortex-a9.Serge Pavlov2014-12-021-2/+0
| | | | llvm-svn: 223120
* Emit warning if define or undef reserved identifier or keyword.Serge Pavlov2014-12-021-0/+2
| | | | | | | | | | | | | | | | | | | | | Summary: This change implements warnings if macro name is identical to a keyword or reserved identifier. The warnings are different depending on the "danger" of the operation. Defining macro that replaces a keyword is on by default. Other cases produce warning that is off by default but can be turned on using option -Wreserved-id-macro. This change fixes PR11488. Reviewers: rnk Reviewed By: rnk Subscribers: rnk, cfe-commits Differential Revision: http://reviews.llvm.org/D6194 llvm-svn: 223114
* [ARM] Define __ARM_FEATURE_DSP macro for CPUs that have DSP instructionsSergey Dmitrouk2014-11-251-1/+32
| | | | | | | | | | | | | | | | | Summary: This resolves [[ http://llvm.org/bugs/show_bug.cgi?id=17391 | PR17391 ]]. GCC's sources were used as a guide (couldn't find much information in ARM documentation). Reviewers: doug.gregor, asl Reviewed By: asl Subscribers: asl, aemerson, cfe-commits Differential Revision: http://reviews.llvm.org/D6339 llvm-svn: 222741
* Convert CR+LF -> LF in a test fileTimur Iskhodzhanov2014-11-201-53/+53
| | | | llvm-svn: 222429
* Avoid earlier test interfering with later one.Richard Smith2014-11-201-2/+2
| | | | llvm-svn: 222403
* Complete support for the SD-6 standing document (based off N4200) with ↵Aaron Ballman2014-11-141-0/+53
| | | | | | support for __has_cpp_attribute. llvm-svn: 221991
* Hook up FreeBSD AArch64 supportEd Maste2014-11-131-0/+193
| | | | | | Patch from Andrew Turner. llvm-svn: 221900
* AArch64: set all processor features from -arch if nothing else presentTim Northover2014-11-101-0/+3
| | | | | | | | | | Darwin's "-arch arm64" option implies full Cyclone CPU, for both architectural and tuning purposes. So if neither of the explicit options have been given, forward that on to the proper invocation. rdar://problem/18906227 llvm-svn: 221631
* [X86] Slightly refactor default features for AMD bdver cpus (NFC). Also add ↵Andrea Di Biagio2014-11-061-0/+10
| | | | | | | | | | | | | | | | | | | missing checks to test for target features. This patch simplifies how default target features are set for AMD bdver2 and bdver1. In particular, method 'getDefaultFeatures' now implements a fallthrough from case 'CK_BDVER2' to case 'CK_BDVER1'. That is because 'bdver2' has the same features available in bdver1 plus BMI, FMA, F16C and TBM. This patch also adds missing checks for predefined macros in test predefined-arch-macros.c. In the case of BTVER2, the test now also checks for F16C, BMI and PCLMUL. In the case of BDVER3 and BDVER4, the test now also checks for the presence of FSGSBASE. Differential Revision: http://reviews.llvm.org/D6134 llvm-svn: 221449
OpenPOWER on IntegriCloud