summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor
Commit message (Collapse)AuthorAgeFilesLines
* Don't Lex past EOF when lexing _PragmaReid Kleckner2014-08-141-0/+2
| | | | | | Fixes PR20662. llvm-svn: 215672
* Add predefined macros to identify x86_64h architectures.Bob Wilson2014-08-081-0/+7
| | | | | | Patch by Jim Grosbach. llvm-svn: 215260
* [SKX] Enabling SKX target (Skylake server chip) Robert Khasanov2014-07-302-0/+117
| | | | | | | | | a) add SKX support to Clang driver; b) add tests for SKX target and AVX512BW, AVX512DQ, AVX512VL features into clang driver tests Patch by Zinovy Nis <zinovy.y.nis@intel.com> llvm-svn: 214306
* Change __INTx_TYPE__ to be always signed. This changes the value forJoerg Sonnenberger2014-07-282-141/+141
| | | | | | | | | | char-based types from "char" to "signed char". Adjust stdint.h to use __INTx_TYPE__ directly without prefixing it with signed and to use __UINTx_TYPE__ for unsigned ones. The value of __INTx_TYPE__ now matches GCC. llvm-svn: 214119
* [PowerPC] Support ELFv1/ELFv2 ABI selection via -mabi= optionUlrich Weigand2014-07-281-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While Clang now supports both ELFv1 and ELFv2 ABIs, their use is currently hard-coded via the target triple: powerpc64-linux is always ELFv1, while powerpc64le-linux is always ELFv2. These are of course the most common scenarios, but in principle it is possible to support the ELFv2 ABI on big-endian or the ELFv1 ABI on little-endian systems (and GCC does support that), and there are some special use cases for that (e.g. certain Linux kernel versions could only be built using ELFv1 on LE). This patch implements the Clang side of supporting this, based on the LLVM commit 214072. The command line options -mabi=elfv1 or -mabi=elfv2 select the desired ABI if present. (If not, Clang uses the same default rules as now.) Specifically, the patch implements the following changes based on the presence of the -mabi= option: In the driver: - Pass the appropiate -target-abi flag to the back-end - Select the correct dynamic loader version (/lib64/ld64.so.[12]) In the preprocessor: - Define _CALL_ELF to the appropriate value (1 or 2) In the compiler back-end: - Select the correct ABI in TargetInfo.cpp - Select the desired ABI for LLVM via feature (elfv1/elfv2) llvm-svn: 214074
* AArch64: use aarch64_be instead of arm64_be in all tests.Tim Northover2014-07-231-1/+0
| | | | | | | | arm64_be doesn't really exist; it was useful for testing while AArch64 and ARM64 were separate, but now the only real way to refer to the system is aarch64_be. llvm-svn: 213747
* [AArch64] Implement Clang CLI interface proposal about "-march".Kevin Qin2014-07-181-11/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Revert "Add default feature for CPUs on AArch64 target in Clang" at r210625. Then, all enabled feature will by passed explicitly by -target-feature in -cc1 option. 2. Get "-mfpu" deprecated. 3. Implement support of "-march". Usage is: -march=armv8-a+[no]feature For instance, "-march=armv8-a+neon+crc+nocrypto". Here "armv8-a" is necessary, and CPU names are not acceptable. Candidate features are fp, neon, crc and crypto. Where conflicting feature modifiers are specified, the right-most feature is used. 4. Implement support of "-mtune". Usage is: -march=CPU_NAME For instance, "-march=cortex-a57". This option will ONLY get micro-architectural feature enabled specifying to target CPU, like "+zcm" and "+zcz" for cyclone. Any architectural features WON'T be modified. 5. Change usage of "-mcpu" to "-mcpu=CPU_NAME+[no]feature", which is an alias to "-march={feature of CPU_NAME}+[no]feature" and "-mtune=CPU_NAME" together. Where this option is used in conjunction with -march or -mtune, those options take precedence over the appropriate part of this option. llvm-svn: 213353
* If char/short are shorter than int, do not use U as suffix forJoerg Sonnenberger2014-07-172-261/+261
| | | | | | | | constants. Comparing int against a constant of the given type like UINT8_MAX will otherwise force a promotion to unsigned int, which is typically not expected. llvm-svn: 213301
* Always set the C suffix macro, even if it is empty.Joerg Sonnenberger2014-07-171-0/+95
| | | | llvm-svn: 213299
* Provide __SIG_ATOMIC_MAX__ next to __SIG_ATOMIC_WIDTH__.Joerg Sonnenberger2014-07-171-0/+32
| | | | llvm-svn: 213289
* Revert "clang/test/Driver/crash-report.c: This requires rewriter for ↵Alp Toker2014-07-161-1/+0
| | | | | | | | | | | | | | | | | | | | | -frewrite-includes. [PR20321]" We've decided to make the core rewriter class and PP rewriters mandatory. They're only a few hundred lines of code in total and not worth supporting as a distinct build configuration, especially since doing so disables key compiler features. This reverts commit r213150. Revert "clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter." This reverts commit r213148. Revert "Move clang/test/Frontend/rewrite-*.c to clang/test/Frontend/Rewriter/" This reverts commit r213146. llvm-svn: 213159
* clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter.NAKAMURA Takumi2014-07-161-0/+1
| | | | llvm-svn: 213148
* Driver: bifurcate extended and basic MSC versioningSaleem Abdulrasool2014-07-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | This restores the original behaviour of -fmsc-version. The older option remains as a mechanism for specifying the basic version information. A secondary option, -fms-compatibility-version permits the user to specify an extended version to the driver. The new version takes the value as a dot-separated value rather than the major * 100 + minor format that -fmsc-version format. This makes it easier to specify the value as well as a more flexible manner for specifying the value. Specifying both values is considered an error. The older parameter is left solely as a driver option, which is normalised into the newer parameter. This allows us to retain a single code path in the compiler itself whilst preserving the semantics of the old parameter as well as avoid having to determine which of two formats are being used by the invocation. The test changes are due to the fact that the compiler no longer supports the old option, and is a direct conversion to the new option. llvm-svn: 213119
* Add __INTMAX_C_SUFFIX__ and __UINTMAX_C_SUFFIX__.Joerg Sonnenberger2014-07-151-0/+67
| | | | llvm-svn: 213097
* Make sure int64_t and uint64_t are consistent.Joerg Sonnenberger2014-07-151-18/+18
| | | | llvm-svn: 213065
* Provide builtin macros as template for PRIab and SCNab, matching theJoerg Sonnenberger2014-07-151-0/+890
| | | | | | underlaying types. llvm-svn: 213063
* Introduce getCorrespondingUnsignedType() in TargetInfo to work like theJoerg Sonnenberger2014-07-141-18/+19
| | | | | | | | corresponding AST context function, only restricted to basic integer types. Use this to ensure getUIntPtrType() gives types consistent with getIntPtrType(). Fix NVPTX backend to give signed intptr_t. llvm-svn: 212982
* [x32] Add __ILP32__ macro for ILP32 platformsPavel Chupin2014-07-141-0/+162
| | | | | | | | | | | | | | | | Summary: Add __ILP32__ and _ILP32 macro for corresponding platforms. Cover x86_64-*-*-gnux32 with test. Test Plan: test added Reviewers: chandlerc, atanasyan Subscribers: cfe-commits, dschuff, zinovy.nis Differential Revision: http://reviews.llvm.org/D4473 llvm-svn: 212931
* Avoid definining more GCC specific predefined macros in clang-clEhsan Akhgari2014-07-101-1/+16
| | | | | | | | | | Reviewers: hansw, rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4419 llvm-svn: 212753
* [mips][mips64r6] Define _MIPS_FPSET, __mips_fpr, and __mips_nan2008 ↵Daniel Sanders2014-07-091-0/+10
| | | | | | | | | | | | correctly on MIPS32r6/MIPS64r6 Summary: This removes the need to pass -mnan=2008 explicitly to be able to compile the test-suite for MIPS32r6/MIPS64r6. Differential Revision: http://reviews.llvm.org/D4433 llvm-svn: 212619
* Do not define __STRICT_ANSI__ in clang-clEhsan Akhgari2014-06-301-0/+1
| | | | llvm-svn: 212066
* ARM: Correctly identify cortex-m4 as v7em.Jim Grosbach2014-06-261-4/+19
| | | | | | | | | | | Get the predefined macro for the architecture correct. cortex-m4: __ARM_ARCH_7EM__ cortex-m3: __ARM_ARCH_7M__ cortex-m0: __ARM_ARCH_6M__ rdar://17420090 llvm-svn: 211792
* Add ppc64/power8 as a targetWill Schmidt2014-06-261-0/+28
| | | | llvm-svn: 211778
* Implement predefined stdint macrosJF Bastien2014-06-252-1/+1721
| | | | | | | | | | | | Add predefined stdint macros that match the given patterns: U?INT{_,_FAST,_LEAST}{8,16,32,64}_{MAX,TYPE} U?INT{PTR,MAX}_{MAX,TYPE} http://reviews.llvm.org/D4141 Author: binji llvm-svn: 211657
* Add -std=c++1z flag for C++17 features.Richard Smith2014-06-161-0/+18
| | | | llvm-svn: 211030
* test: add missed file in previous commitSaleem Abdulrasool2014-06-151-3/+3
| | | | llvm-svn: 210992
* Preprocessor: improve ACLE 6.4.1, 6.4.2 supportSaleem Abdulrasool2014-06-151-0/+40
| | | | | | | | | | | | | | | | | | This improves conformance with ACLE 6.4.1. Define additional macros that indicate support for the ARM and Thumb instruction set architecture. This includes the following set of macros: __ARM_ARCH __ARM_ARCH_ISA_ARM __ARM_ARCH_ISA_THUMB __ARM_32BIT_STATE These help identify the environment that the code is intended to execute on. Adjust the handling for ACLE 6.4.2 to be more correct. We would define the profile as a free-standing token rather than a quoted single character. llvm-svn: 210991
* [AArch64] Add default features for CPUs on AArch64 target.Kevin Qin2014-06-111-0/+10
| | | | | | | | | | For ARM target, we can use CRYPTO and CRC features if we select cortex-a57 by '-mcpu', but for AArch64 target, it doesn't work unless adding with '-mfpu=crypto-neon-fp-armv8'. To keep consistency between front-end and back-end and get end-users more easier to use, we'd better add default feature for CPUs on AArch64 target as well. llvm-svn: 210625
* [mips] Add macros _MIPS_ISA and __mips_isa_rev (same expansion as defined by ↵Matheus Almeida2014-06-051-1/+13
| | | | | | | | | | | | | | GCC). Summary: The Linux Kernel is one example of a piece of software that relies on them. Reviewers: atanasyan Reviewed By: atanasyan Differential Revision: http://reviews.llvm.org/D3756 llvm-svn: 210270
* Preprocessor: make C++ operator names as macro identifiers a compatible ↵Alp Toker2014-05-311-1/+2
| | | | | | | | | | | extension With recent changes, this is now a compatible language extension and can be safely enabled with -ms-extensions instead of requiring the full -ms-compatibility MSVC drop-in mode. As such we can now also emit an extension warning under -Wmicrosoft to help users port their code. llvm-svn: 209978
* Preprocessor: recover gracefully when C++ operator names are used as macro ↵Alp Toker2014-05-311-2/+11
| | | | | | | | | | identifiers This failure mode shows up occasionally when users try to include C headers in C++ projects or when porting from Windows. We might as well recover in the way the user expected, thus avoiding confusing diagnostic messages at point of use. llvm-svn: 209963
* Provide an aka for the C++ operator name macro diagnosticAlp Toker2014-05-211-3/+3
| | | | llvm-svn: 209322
* Preprocessor: support defined() with operator names for MS compatibilityAlp Toker2014-05-214-10/+39
| | | | | | | | | Also flesh out missing tests, improve diagnostic QOI and fix a couple of corner cases found in the process. Fixes PR10606. llvm-svn: 209276
* Add __ARM_DWARF_EH__ to signify the use of Itanium ABI for unwindJoerg Sonnenberger2014-05-131-0/+1
| | | | | | instructions. llvm-svn: 208719
* Test preprocessor defines for NetBSD/ARM.Joerg Sonnenberger2014-05-131-0/+103
| | | | llvm-svn: 208718
* Target: fix wchar_t definition for Windows on ARMSaleem Abdulrasool2014-05-041-0/+5
| | | | | | | | Windows on ARM uses AAPCS, but has some deviations. wchar_t remains an unsigned short on WoA, which does not conform to AAPCS. Ensure that wchar_t is defined accordingly. llvm-svn: 207929
* Add support for -march=bdver4.Benjamin Kramer2014-05-021-0/+70
| | | | llvm-svn: 207848
* [ARM64/AArch64] Define the correct value for __ARM_NEON_FPBradley Smith2014-05-021-2/+7
| | | | llvm-svn: 207842
* [ARM64/AArch64] Hook up CRC32 subtarget feature to the driverBradley Smith2014-05-021-0/+5
| | | | llvm-svn: 207841
* do not warn about unknown pragmas in modes that do not handle them (pr9537)Lubos Lunak2014-05-011-0/+10
| | | | | | | And refactor to have just one place in code that sets up the empty pragma handlers. llvm-svn: 207758
* Fix and restore the macro-multiline.c testAlp Toker2014-04-192-8/+7
| | | | | | | | | | | | | This test didn't work as intended and was ultimately disabled some years ago in r169458. Indeed it's not clear if the '\n' was ever passed through to the driver correctly given that lit would insert '&& {' at the newline. Test rewritten to use printf/xargs to insert '\n' in a more reliable manner and to use FileCheck for verification. llvm-svn: 206703
* [ARM64] Add ARM64 RUN lines to a bunch of tests that had AARCH64 RUN lines.James Molloy2014-04-172-0/+3
| | | | | | | This covers all tests in tests/Driver and tests/Preprocessor, but there are some failing tests in test/Sema that need looking into. llvm-svn: 206464
* Revert "Move -fms-extensions predefined macros into InitPreprocessor"Reid Kleckner2014-04-161-6/+2
| | | | | | | | | | This reverts commit r206413. This was proposed before, but it's not clear if this is really a good idea: http://reviews.llvm.org/D3034 llvm-svn: 206415
* Move -fms-extensions predefined macros into InitPreprocessorReid Kleckner2014-04-161-2/+6
| | | | | | | If someone on Linux asks for -fms-extensions, there's no reason not to define the feature test macros that MSVC defines. llvm-svn: 206413
* [ARM64] Allow the disabling of NEON and crypto instructions. Update tests to ↵James Molloy2014-04-161-2/+0
| | | | | | pass -target-feature +neon. llvm-svn: 206394
* [ARM64] Fix up predefines, including adding big endian support to Targets.cppJames Molloy2014-04-161-0/+2
| | | | llvm-svn: 206390
* Driver: add target definition for Windows on ARMSaleem Abdulrasool2014-04-041-0/+33
| | | | | | | | | This introduces the definitions needed for the Windows on ARM target. Add target definitions for both the MSVC environment and the MSVC + Itanium C++ ABI environment. The Visual Studio definitions correspond to the definitions provided by Visual Studio 2012. llvm-svn: 205650
* Put macro redefinition warnings under -Wmacro-redefinedReid Kleckner2014-04-041-0/+19
| | | | | | | | | | | This is consistent with -Wbuiltin-macro-redefined, and puts this common extension warning under a flag. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D3283 llvm-svn: 205591
* clang/test/Preprocessor/headermap-rel2.c: Recognize dos path.NAKAMURA Takumi2014-03-301-2/+2
| | | | llvm-svn: 205152
* Force a header file input to the headermap test to have differentChandler Carruth2014-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | contents than the header file by the same name under the system header search root. Surprisingly, this is required to get the test to pass on some systems. So, it turns out that there exist filesystems in the world which unique the inode of all files based on their contents. This results in two files with the same contents at different paths suddenly having the same inode. This doesn't actually cause any problems in practice as the contents are the same, and the path used to access the files are the same. However, it can cause tests like this one to be more brittle because the file manager ends up de-duplicating the file entries by inode. We don't have any other really easy ways to observe the behavior shift because the whole point is that the #include written in the source code doesn't contain the information -- instead it is contained in the header map. If folks have other solutions they would prefer, I'm more than happy to work on them, but this seems a reasonable way to ensure that the test in question exercises the code it wants to exercise. llvm-svn: 205149
OpenPOWER on IntegriCloud