summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor/init.c
Commit message (Collapse)AuthorAgeFilesLines
* Add -std=c++20 flag, replace C++2a with C++20 throughout the ClangRichard Smith2020-02-191-2/+8
| | | | | | | | | | | | | user interface and documentation, and update __cplusplus for C++20. WG21 considers the C++20 standard to be finished (even though it still has some more steps to pass through in the ISO process). The old flag names are accepted for compatibility, as usual, and we still have lots of references to C++2a in comments and identifiers; those can be cleaned up separately. (cherry picked from commit 24ad121582454e625bdad125c90d9ac0dae948c8)
* [Driver][PowerPC] Move powerpcspe logic from cc1 to DriverFangrui Song2020-01-101-1/+0
| | | | | | | | | Follow-up of D72014. It is more appropriate to use a target feature instead of a SubTypeArch to express the difference. Reviewed By: #powerpc, jhibbits Differential Revision: https://reviews.llvm.org/D72433
* [PowerPC]: Add powerpcspe target triple subarch componentJustin Hibbits2020-01-081-1/+2
| | | | | | | | | | Summary: This allows the use of '-target powerpcspe-unknown-linux-gnu' or 'powerpcspe-unknown-freebsd' to be used, instead of '-target powerpc-unknown-linux-gnu -mspe'. Reviewed By: dim Differential Revision: https://reviews.llvm.org/D72014
* [test] Move ppc64 tests from test/Preprocessor/init.c to init-ppc64.cFangrui Song2020-01-071-1072/+0
|
* [PS4] Predefine the __SCE__ macro for the x86_64-scei-ps4 tripleWarren Ristow2019-12-121-0/+1
|
* [PowerPC] Add new Future CPU for PowerPCStefan Pintilie2019-11-211-0/+16
| | | | | | | | | | | This patch will add -mcpu=future into clang for PowerPC. A CPU type is required for work that may possibly be enabled for some future Power CPU. The CPU type future will serve that purpose. This patch introduces no new functionality. It is an incremental patch on top of which Power PC work for some future CPU can be done. Differential Revision: https://reviews.llvm.org/D70262
* Add 8548 CPU definition and attributesJustin Hibbits2019-11-121-0/+6
| | | | | | | | 8548 CPU is GCC's name for the e500v2, so accept this in clang. The e500v2 doesn't support lwsync, so define __NO_LWSYNC__ for this as well, as GCC does. Differential Revision: https://reviews.llvm.org/D67787
* [mips] Set macros for Octeon+ CPUSimon Atanasyan2019-11-071-0/+10
|
* [mips] Set __OCTEON__ macrosSimon Atanasyan2019-11-051-0/+1
|
* [mips] Fix `__mips_isa_rev` macros value for Octeon CPUSimon Atanasyan2019-11-051-0/+9
|
* Add -fgnuc-version= to control __GNUC__ and other GCC macrosReid Kleckner2019-10-101-70/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed that compiling on Windows with -fno-ms-compatibility had the side effect of defining __GNUC__, along with __GNUG__, __GXX_RTTI__, and a number of other macros for GCC compatibility. This is undesirable and causes Chromium to do things like mix __attribute__ and __declspec, which doesn't work. We should have a positive language option to enable GCC compatibility features so that we can experiment with -fno-ms-compatibility on Windows. This change adds -fgnuc-version= to be that option. My issue aside, users have, for a long time, reported that __GNUC__ doesn't match their expectations in one way or another. We have encouraged users to migrate code away from this macro, but new code continues to be written assuming a GCC-only environment. There's really nothing we can do to stop that. By adding this flag, we can allow them to choose their own adventure with __GNUC__. This overlaps a bit with the "GNUMode" language option from -std=gnu*. The gnu language mode tends to enable non-conforming behaviors that we'd rather not enable by default, but the we want to set things like __GXX_RTTI__ by default, so I've kept these separate. Helps address PR42817 Reviewed By: hans, nickdesaulniers, MaskRay Differential Revision: https://reviews.llvm.org/D68055 llvm-svn: 374449
* Add -m(no)-spe to clangJustin Hibbits2019-09-051-0/+5
| | | | | | | | | | | | | | Summary: r337347 added support for the Signal Processing Engine (SPE) to LLVM. This follows that up with the clang side. This adds -mspe and -mno-spe, to match GCC. Subscribers: nemanjai, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D49754 llvm-svn: 371066
* [clang, test] Fix Clang :: Headers/max_align.c on 64-bit SPARCRainer Orth2019-07-231-0/+1
| | | | | | | | | | | | | | | | | | | | | Clang :: Headers/max_align.c currently FAILs on 64-bit SPARC: error: 'error' diagnostics seen but not expected: File /vol/llvm/src/clang/dist/test/Headers/max_align.c Line 12: static_assert failed due to requirement '8 == _Alignof(max_align_t)' "" 1 error generated. This happens because SuitableAlign isn't defined for SPARCv9 unlike SPARCv8 (which uses the default of 64 bits). gcc's sparc/sparc.h has #define BIGGEST_ALIGNMENT (TARGET_ARCH64 ? 128 : 64) This patch sets SuitableAlign to match and updates the corresponding testcase. Tested on sparcv9-sun-solaris2.11. Differential Revision: https://reviews.llvm.org/D64487 llvm-svn: 366820
* Change a lit test to permit vendor specific clang versionNathan Lanza2019-07-161-1/+1
| | | | | | | A test manually checks for the string `__VERSION__ "Clang`. This needs to permit vendor specific variants. llvm-svn: 366166
* Allow for vendor prefixes in a list testNathan Lanza2019-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | | Summary: Preprocessor/init.c contains a line that explicitly checks for the string __VERSION__ "Clang{{.*}} It's valid to have a toolchain configured to emit a vendor prefix before the word Clang. e.g. __VERSION__ "Vendor Clang{{.*}} Subscribers: fedor.sergeev, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64772 llvm-svn: 366159
* Update __VERSION__ to remove the hardcoded 4.2.1 versionSylvestre Ledru2019-07-151-2/+2
| | | | | | | | | | | | | | | | | | Summary: Just like in https://reviews.llvm.org/D56803 for -dumpversion Reviewers: rnk Reviewed By: rnk Subscribers: dexonsmith, lebedev.ri, hubert.reinterpretcast, xbolva00, fedor.sergeev, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63048 llvm-svn: 366091
* This reverts commit 632a36bfcfc8273c1861f04ff6758d863c47c784.Sylvestre Ledru2019-07-131-0/+4
| | | | | | | | | | | | Some targets such as Python 2.7.16 still use VERSION in their builds. Without VERSION defined, the source code has syntax errors. Reverting as it will probably break many other things. Noticed by Sterling Augustine llvm-svn: 365992
* Remove __VERSION__Sylvestre Ledru2019-07-121-4/+0
| | | | | | | | | | | | | | | | | | | | Summary: It has been introduced in 2011 for gcc compat: https://github.com/llvm-mirror/clang/commit/ad1a4c6e89594e704775ddb6b036ac982fd68cad it is probably time to remove it Reviewers: rnk, dexonsmith Reviewed By: rnk Subscribers: dschuff, aheejin, fedor.sergeev, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64062 llvm-svn: 365962
* Fix the predefined exponent limit macros for the 16-bit IEEE format.John McCall2019-05-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The magnitude range of normalized _Float16 is 2^-14 (~6e-5) to (2-2^-10)*2^15 (65504). You might think, then, that the code is correct to defne FLT16_MIN_EXP and FLT16_MAX_EXP to be -14 and 15 respectively. However, for some reason the C specification actually specifies a bias for these macros: C11 5.2.4.2.2: - minimum negative integer such that FLT_RADIX raised to one less than that power is a normalized floating-point number, e_min: FLT_MIN_EXP DBL_MIN_EXP LDBL_MIN_EXP - maximum integer such that FLT_RADIX raised to one less than that power is a representable finite floating-point number, e_max: FLT_MAX_EXP DBL_MAX_EXP LDBL_MAX_EXP FLT16_MIN_EXP and FLT16_MAX_EXP should clearly be biased the same way, and other compilers do in fact do so, as do our OpenCL headers for `half`. Additionally, FLT16_MIN_10_EXP is just wrong. llvm-svn: 362183
* Add AIX Version MacrosXing Xue2019-05-161-0/+123
| | | | | | | | | | | | | | | | | | | | Summary: - This patch checks the AIX version and defines the appropriate macros. - Follow up to a comment on D59048. Author: andusy Reviewers: hubert.reinterpretcast, jasonliu, sfertile, xingxue Reviewed By: sfertile Subscribers: jsji, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61530 llvm-svn: 360900
* [WebAssembly] Use the "wasm32-wasi" triple in testsDan Gohman2019-04-301-2/+2
| | | | | | | | | | | Similar to https://reviews.llvm.org/D61334, update clang tests to use the "wasm32-wasi" triple, removing the "-musl" environment and omitting the "-unknown" vendor. Differential Revision: https://reviews.llvm.org/D61338 Reviewer: sbc100 llvm-svn: 359630
* [X86] Correct the value of MaxAtomicInlineWidth for pre-586 cpusCraig Topper2019-03-211-4/+52
| | | | | | | | | | Use the new cx8 feature flag that was added to the backend to represent support for cmpxchg8b. Use this flag to set the MaxAtomicInlineWidth. This also assumes all the cmpxchg instructions are enabled for CK_Generic which is what cc1 defaults to when nothing is specified. Differential Revision: https://reviews.llvm.org/D59566 llvm-svn: 356709
* Reland the rest of "Add AIX Target Info"Jason Liu2019-03-141-0/+415
| | | | | | | | | llvm-svn 356197 relanded previously failing test case max_align.c. This commit will reland the rest of llvm-svn 356060 commit. Differential Revision: https://reviews.llvm.org/D59048 llvm-svn: 356208
* Revert "Add AIX Target Info"Jason Liu2019-03-131-415/+0
| | | | | | | | | This reverts commit 4e192d0e1e72ce32fabf1bccc06ac31ab5385e78. The newly added test case max_align.c do not work on all platforms. original llvm-svn: 356060 llvm-svn: 356070
* Add AIX Target InfoJason Liu2019-03-131-0/+415
| | | | | | | | | | | | | | | | | | Summary: A first pass over platform-specific properties of the C API/ABI on AIX for both 32-bit and 64-bit modes. This is a continuation of D18360 by Andrew Paprocki and further work by Wu Zhao. Patch by Andus Yu Reviewers: apaprocki, chandlerc, hubert.reinterpretcast, jasonliu, xingxue, sfertile Reviewed by: hubert.reinterpretcast, apaprocki, sfertile Differential Revision: https://reviews.llvm.org/D59048 llvm-svn: 356060
* Make predefined FLT16 macros conditional on support for the typeNemanja Ivanovic2019-02-201-14/+14
| | | | | | | | | | | | We unconditionally predefine these macros. However, they may be used to determine if the type is supported. In that case, there are unnecessary failures to compile the code. This is the proposed fix for https://bugs.llvm.org/show_bug.cgi?id=40559 Differential revision: https://reviews.llvm.org/D57577 llvm-svn: 354512
* [PowerPC] Stop defining _ARCH_PWR6X on POWER7 and upHubert Tong2019-02-131-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The predefined macro `_ARCH_PWR6X` is associated with GCC's `-mcpu=power6x` option, which enables generation of P6 "raw mode" instructions such as `mftgpr`. Later POWER processors build upon the "architected mode", not the raw one. `_ARCH_PWR6X` should not be defined for these later processors. Fixes PR#40236. Reviewers: echristo, hfinkel, kbarton, nemanjai, wschmidt Reviewed By: hfinkel Subscribers: jsji, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58128 llvm-svn: 353975
* [MSP430] Ajust f32/f64 alignment according to MSP430 EABIAnton Korobeynikov2019-01-251-1/+1
| | | | | | | | Patch by Kristina Bessonova! Differential Revision: https://reviews.llvm.org/D57015 llvm-svn: 352177
* [WebAssembly] Add a __wasi__ target macroDan Gohman2019-01-241-0/+7
| | | | | | | | | This adds a `__wasi__` macro for the wasi OS, similar to `__linux__` etc. for other OS's. Differential Revision: https://reviews.llvm.org/D57155 llvm-svn: 352105
* [WebAssembly] Support __float128Dan Gohman2019-01-241-0/+1
| | | | | | | | This enables support for the "__float128" keyword. Differential Revision: https://reviews.llvm.org/D57154 llvm-svn: 352100
* [WebAssembly] Factor commonality between wasm32 and wasm64 in ↵Dan Gohman2019-01-241-633/+342
| | | | | | | | | | | test/Preprocessor/init.c Use the -check-prefixes= feature to merge most of the WEBASSEMBLY32 and WEBASSEMBLY64 test checks into a shared WEBASSEMBLY test check. Differential Revision: https://reviews.llvm.org/D57153 llvm-svn: 352099
* Android is not GNU, so don't claim that it is.Dan Albert2019-01-081-0/+2
| | | | | | | | | | | | Reviewers: pirama, srhines Reviewed By: srhines Subscribers: kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D55953 llvm-svn: 350664
* Basic: make `int_least64_t` and `int_fast64_t` match on DarwinSaleem Abdulrasool2018-12-121-12/+12
| | | | | | | | | The Darwin targets use `int64_t` and `uint64_t` to define the `int_least64_t` and `int_fast64_t` types. The underlying type is actually a `long long`. Match the types to allow the printf specifiers to work properly and have the compiler vended macros match the implementation on the target. llvm-svn: 348939
* [AArch64] Define __ELF__ for aarch64-none-elf and other similar triples.Eli Friedman2018-10-171-0/+1
| | | | | | | | "aarch64-none-elf" is commonly used for AArch64 baremetal toolchains. Differential Revision: https://reviews.llvm.org/D53348 llvm-svn: 344710
* Introduce code_model macrosAli Tamur2018-10-081-18/+22
| | | | | | | | | | | | | | | | | | | Summary: gcc defines macros such as __code_model_small_ based on the user passed command line flag -mcmodel. clang accepts a flag with the same name and similar effects, but does not generate any macro that the user can use. This cl narrows the gap between gcc and clang behaviour. However, achieving full compatibility with gcc is not trivial: The set of valid values for mcmodel in gcc and clang are not equal. Also, gcc defines different macros for different architectures. In this cl, we only tackle an easy part of the problem and define the macro only for x64 architecture. When the user does not specify a mcmodel, the macro for small code model is produced, as is the case with gcc. Reviewers: compnerd, MaskRay Reviewed By: MaskRay Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D52920 llvm-svn: 344000
* Basic: correct `__WINT_TYPE__` on WindowsSaleem Abdulrasool2018-09-191-3/+3
| | | | | | | | | Windows uses `unsigned short` for `wint_t`. Correct the type definition as vended by the compiler. This type is defined in corecrt.h and is unconditionally typedef'ed. cl does not have an equivalent to `__WINT_TYPE__` which is why this was never detected. llvm-svn: 342557
* [clang][mips] Set __mips_fpr correctly for -mfpxxStefan Maksimovic2018-08-221-3/+38
| | | | | | | | | | | | | | | | | | | | Set __mips_fpr to 0 if o32 ABI is used with either -mfpxx or none of -mfp32, -mfpxx, -mfp64 being specified. Introduce additional checks: -mfpxx is only to be used in conjunction with the o32 ABI. report an error when incompatible options are provided. Formerly no errors were raised when combining n32/n64 ABIs with -mfp32 and -mfpxx. There are other cases when __mips_fpr should be set to 0 that are not covered, ex. using o32 on a mips64 cpu which is valid but not supported in the backend as of yet. Differential Revision: https://reviews.llvm.org/D50557 llvm-svn: 340391
* [Android] Increase default new alignment for AndroidPirama Arumuga Nainar2018-08-011-1/+1
| | | | | | | | | | | | | | Summary: Android's memory allocators also guarantee 8-byte alignment for 32-bit architectures and 16-byte alignment for 64-bit. Reviewers: rsmith Subscribers: cfe-commits, srhines, enh Differential Revision: https://reviews.llvm.org/D50112 llvm-svn: 338603
* [WebAssembly] Change size_t to `unsigned long`.Dan Gohman2018-07-241-20/+20
| | | | | | | | | | | | Changing it to unsigned long (which is 32-bit on wasm32) makes it the same type as wasm64 (where unsigned long is 64-bit), which would eliminate the most common cause for mangled names being different between wasm32 and wasm64. For example, export lists containing symbol names could now often be the same between wasm32 and wasm64. Differential Revision: https://reviews.llvm.org/D40526 llvm-svn: 337783
* By popular demand, switch in64_t on NetBSD/AArch64 and NetBSD/PowerPC64Joerg Sonnenberger2018-07-171-16/+16
| | | | | | to long for consistency with other 64bit platforms. llvm-svn: 337271
* [PowerPC] The __float128 type should only be available on Power9Stefan Pintilie2018-06-131-1/+1
| | | | | | | | | | | | Diasble the use of the type __float128 for PPC machines older than Power9. The use of -mfloat128 for PPC machine older than Power9 will result in an error. Differential Revision: https://reviews.llvm.org/D48088 llvm-svn: 334613
* Revert "Revert r332955 "GNUstep Objective-C ABI version 2""David Chisnall2018-05-221-0/+7
| | | | llvm-svn: 332963
* Revert r332955 "GNUstep Objective-C ABI version 2"Bjorn Pettersson2018-05-221-7/+0
| | | | | | | Reverted due to buildbot failures. Seems like isnumber() is some Apple addition to cctype. llvm-svn: 332957
* GNUstep Objective-C ABI version 2David Chisnall2018-05-221-0/+7
| | | | | | | | | | | | | | | | | | | | | Summary: This includes initial support for the (hopefully final) updated Objective-C ABI, developed here: https://github.com/davidchisnall/clang-gnustep-abi-2 It also includes some cleanups and refactoring from older GNU ABIs. The current version is ELF only, other formats to follow. Reviewers: rjmccall, DHowett-MSFT Reviewed By: rjmccall Subscribers: smeenai, cfe-commits Differential Revision: https://reviews.llvm.org/D46052 llvm-svn: 332950
* Fix test failure caused by r329965.Eli Friedman2018-04-121-1/+1
| | | | | | | | "-mllvm" options get parsed slightly earlier, and -arm-restrict-it is only available if the ARM target is compiled in. Invoke "clang -cc1" directly to avoid the issue. llvm-svn: 329968
* Correct the alignment for the PS4 targetMatthew Voss2018-03-071-0/+3
| | | | | | https://reviews.llvm.org/D44218 llvm-svn: 326942
* [RISCV] Enable __int128_t and __uint128_t through clang flagMandeep Singh Grang2018-02-251-0/+4
| | | | | | | | | | | | | | | | Summary: If the flag -fforce-enable-int128 is passed, it will enable support for __int128_t and __uint128_t types. This flag can then be used to build compiler-rt for RISCV32. Reviewers: asb, kito-cheng, apazos, efriedma Reviewed By: asb, efriedma Subscribers: shiva0217, efriedma, jfb, dschuff, sdardis, sbc100, jgravelle-google, aheejin, rbar, johnrusso, simoncook, jordy.potman.lists, sabuasal, niosHD, cfe-commits Differential Revision: https://reviews.llvm.org/D43105 llvm-svn: 326045
* [RISCV] Create a LinuxTargetInfo when targeting LinuxAlex Bradbury2018-02-031-0/+18
| | | | | | | | | | | | | | Previously, RISCV32TargetInfo or RISCV64TargetInfo were created unconditionally. Use LinuxTargetInfo<RISCV??TargetInfo> to ensure that the proper OS-specific defines are present. This patch only adds logic to instantiate LinuxTargetInfo and leaves a TODO, as I'm reluctant to add logic for other targets (e.g. FreeBSD, RTEMS) until I've produced and tested at least one binary for that OS+target combo. Thanks to @mgrang to reporting the issue. llvm-svn: 324170
* [RISCV] Add the RISCV target and compiler driverAlex Bradbury2018-01-111-0/+395
| | | | | | | | | As RV64 codegen has not yet been upstreamed into LLVM, we focus on RV32 driver support (RV64 to follow). Differential Revision: https://reviews.llvm.org/D39963 llvm-svn: 322276
* Add __WINT_MAX__.Ed Schouten2017-12-051-0/+4
| | | | | | | This definition is similar to __WCHAR_MAX__, except that it applies to wint_t. It's also documented as being supported by GCC 4.5 and later. llvm-svn: 319746
OpenPOWER on IntegriCloud