summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor/init.c
Commit message (Collapse)AuthorAgeFilesLines
...
* [mips] Introducing option -mabs=[legacy/2008]Petar Jovanovic2017-08-241-0/+10
| | | | | | | | | | | | | | | | | In patch r205628 using abs.[ds] instruction is forced, as they should behave in accordance with flags Has2008 and ABS2008. Unfortunately for revisions prior mips32r6 and mips64r6, abs.[ds] is not generating correct result when working with NaNs. To generate a sequence which always produce a correct result but also to allow user more control on how his code is compiled, option -mabs is added where user can choose legacy or 2008. By default legacy mode is used on revisions prior R6. Mips32r6 and mips64r6 use abs2008 mode by default. Patch by Aleksandar Beserminji Differential Revision: https://reviews.llvm.org/D35982 llvm-svn: 311669
* Revert r310057Stefan Maksimovic2017-08-111-0/+10
| | | | | | | | Bring back changes which r304953 introduced since they were in fact not the cause of failures described in r310057 commit message. llvm-svn: 310702
* Add OpenCL 2.0 atomic builtin functions as Clang builtinYaxun Liu2017-08-041-0/+10
| | | | | | | | | | | | | | | | | | | | | OpenCL 2.0 atomic builtin functions have a scope argument which is ideally represented as synchronization scope argument in LLVM atomic instructions. Clang supports translating Clang atomic builtin functions to LLVM atomic instructions. However it currently does not support synchronization scope of LLVM atomic instructions. Without this, users have to use LLVM assembly code to implement OpenCL atomic builtin functions. This patch adds OpenCL 2.0 atomic builtin functions as Clang builtin functions, which supports generating LLVM atomic instructions with synchronization scope operand. Currently only constant memory scope argument is supported. Support of non-constant memory scope argument will be added later. Differential Revision: https://reviews.llvm.org/D28691 llvm-svn: 310082
* Revert r304953 for release 5.0.0Stefan Maksimovic2017-08-041-10/+0
| | | | | | | | | | This is causing failures when compiling clang with -O3 as one of the structures used by clang is passed by value and uses the fastcc calling convention. Faliures manifest for stage2 mips build. llvm-svn: 310057
* Define _GNU_SOURCE for RTEMS c++Walter Lee2017-08-021-0/+1
| | | | | | | | | | | | Summary: This is required by the libc++ locale support. Reviewers: jyknight Subscribers: fedor.sergeev Differential Revision: https://reviews.llvm.org/D36121 llvm-svn: 309815
* [AArch64] Don't define __LP64__ when targeting WindowsMartin Storsjo2017-07-311-0/+161
| | | | | | | | | Windows/ARM64 is a LLP64 environment, so don't set this default define. Differential Revision: https://reviews.llvm.org/D36098 llvm-svn: 309619
* [test] Fix mistagged CHECK-NOT-lines for AARCH64-DARWIN in Preprocessor/init.cMartin Storsjo2017-07-311-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D36099 llvm-svn: 309618
* Fix a typo.Brad Smith2017-07-301-1/+1
| | | | llvm-svn: 309522
* Remove Bitrig: Clang ChangesErich Keane2017-07-211-7/+0
| | | | | | | | Bitrig code has been merged back to OpenBSD, thus the OS has been abandoned. Differential Revision: https://reviews.llvm.org/D35708 llvm-svn: 308797
* [c++2a] Add option -std=c++2a to enable support for potential/transitional ↵Faisal Vali2017-07-161-0/+16
| | | | | | | | | | C++2a features - as usual C++2a implies all the C++'s that came before it. Thank you Aaron for the feedback here: https://reviews.llvm.org/D35454 llvm-svn: 308118
* NetBSD uses soft-float by default, unless the environment is EABIHF orJoerg Sonnenberger2017-07-111-0/+6
| | | | | | GNUEABIHF. llvm-svn: 307665
* Run the preprocessor test as frontend test for NetBSD, since CC1 modeJoerg Sonnenberger2017-07-111-3/+3
| | | | | | | doesn't get flags like the default target CPU. Update for test to reflect the difference. llvm-svn: 307664
* Revert "Define _GNU_SOURCE for rtems c++"Daniel Jasper2017-06-151-1/+0
| | | | | | | | | | | | | | | | | This reverts commit r305399. This breaks a build in libcxx: libcxx/src/system_error.cpp:90:16: error: assigning to 'int' from incompatible type 'char *' if ((ret = ::strerror_r(ev, buffer, strerror_buff_size)) != 0) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. Which makes sense according to: https://linux.die.net/man/3/strerror_r Not entirely sure how this needs to be fixed. llvm-svn: 305456
* Define _GNU_SOURCE for rtems c++James Y Knight2017-06-141-0/+1
| | | | | | | | | | This is required by the libc++ locale support. Patch by Walter Lee. Differential Revision: https://reviews.llvm.org/D34105 llvm-svn: 305399
* Reapply r304929 [mips] Add runtime options to enable/disable madd/sub.fmtPetar Jovanovic2017-06-071-0/+10
| | | | | | | | | | | | | | | | | The test in r304929 broke multiple buildbots as it expected mips target to be registered and available (which is not necessarily true). Updating the test with this condition. Original commit: [mips] Add runtime options to enable/disable madd.fmt and msub.fmt Add options to clang: -mmadd4 and -mno-madd4, use it to enable or disable generation of madd.fmt and similar instructions respectively, as per GCC. Patch by Stefan Maksimovic. llvm-svn: 304953
* Revert r304929 [mips] Add runtime options to enable/disable madd/sub.fmtPetar Jovanovic2017-06-071-10/+0
| | | | | | | | | | | | | | | Revert r304929 since the test broke buildbots. Original commit: [mips] Add runtime options to enable/disable madd.fmt and msub.fmt Add options to clang: -mmadd4 and -mno-madd4, use it to enable or disable generation of madd.fmt and similar instructions respectively, as per GCC. Patch by Stefan Maksimovic. llvm-svn: 304935
* [mips] Add runtime options to enable/disable madd.fmt and msub.fmtPetar Jovanovic2017-06-071-0/+10
| | | | | | | | | | | Add options to clang: -mmadd4 and -mno-madd4, use it to enable or disable generation of madd.fmt and similar instructions respectively, as per GCC. Patch by Stefan Maksimovic. Differential Revision: https://reviews.llvm.org/D33401 llvm-svn: 304929
* [WebAssembly] Set MaxAtomicInlineWidth to 64.Dan Gohman2017-06-071-2/+2
| | | | | | | | The WebAssembly threads proposal has changed such that C++ implementations can now declare that atomics up to 64 bits are "lock free" in C++'s terms. llvm-svn: 304859
* Darwin: Define __STDC_NO_THREADS__ on Darwin targetsDuncan P. N. Exon Smith2017-04-271-0/+9
| | | | | | | | | Darwin doesn't support C11 threads.h. Define `__STDC_NO_THREADS__` so that users can check for it. rdar://problem/18461003 llvm-svn: 301508
* Add __CLANG_ATOMIC_<TYPE>_LOCK_FREE macros for use in MSVC compatibility mode.Eric Fiselier2017-04-201-0/+53
| | | | | | | | | | | | | | | | | Summary: Libc++ currently implements the `ATOMIC_<TYPE>_LOCK_FREE` macros using the `__GCC_ATOMIC_<TYPE>_LOCK_FREE` macros. However these are not available when MSVC compatibility is enabled even though C11 `_Atomic` is. This prevents libc++ from correctly implementing `ATOMIC_<TYPE>_LOCK_FREE`. This patch adds an alternative spelling `__CLANG_ATOMIC_<TYPE>_LOCK_FREE` that is enabled with `-fms-compatibility`. Reviewers: rsmith, aaron.ballman, majnemer, zturner, compnerd, jfb, rnk Reviewed By: rsmith Subscribers: BillyONeal, smeenai, jfb, cfe-commits, dschuff Differential Revision: https://reviews.llvm.org/D32265 llvm-svn: 300914
* [ARM,AArch64] Define __ELF__ for arm-none-eabihf and AArch64Oliver Stannard2017-04-181-0/+3
| | | | | | | This macro is defined for arm-none-eabi as of r266625, but it should also be defined for eabihf and aarch64. llvm-svn: 300549
* _CALL_LINUX is only defined on 64-bit ppc linux platforms, not 32-bit.Eric Christopher2017-03-251-0/+4
| | | | | | Adjust and add a test for the 32-bit side. llvm-svn: 298778
* Add the __LONGDOUBLE128 define for ppc targets that have 128 bit long doubles.Eric Christopher2017-03-251-0/+7
| | | | llvm-svn: 298770
* Define __HAVE_BSWAP__ on ppc to match gcc since we support both builtins as ↵Eric Christopher2017-03-251-0/+6
| | | | | | well. llvm-svn: 298769
* Add the _CALL_LINUX preprocessor define for ppc linux platforms.Eric Christopher2017-03-251-0/+6
| | | | | | | | This typically is only for a new enough linker (bfd >= 2.16.2 or gold), but our ppc suppport post-dates this and it should work on all linux platforms. It is guaranteed to work on all elfv2 platforms. llvm-svn: 298765
* __BIGGEST_ALIGNMENT__ has always been 16 on all power platforms ratherEric Christopher2017-03-251-6/+6
| | | | | | than the default of 8 in clang, fix and update tests accordingly. llvm-svn: 298761
* Add preprocessor defines for a bare powerpc64le triple/cpu.Eric Christopher2017-03-251-0/+3
| | | | | | | The le triple didn't exist until power8, so use that as a default (this also matches what gcc does). llvm-svn: 298759
* Bump __cplusplus for C++17 to 201703L per the C++17 DIS.Richard Smith2017-03-201-2/+2
| | | | llvm-svn: 298299
* Add a small test for __STRUCT_PARM_ALIGN__ for ppc64 darwin.Eric Christopher2017-03-161-1/+4
| | | | llvm-svn: 298006
* Set the Int64Type / IntMaxType types correctly for OpenBSD/mips64Brad Smith2017-03-061-0/+2
| | | | llvm-svn: 297098
* Also test OpenBSD/powerpc here for the various types expected to be the same ↵Brad Smith2017-02-251-0/+1
| | | | | | across archs. llvm-svn: 296256
* Hook up OpenBSD AArch64 supportBrad Smith2017-02-211-0/+193
| | | | llvm-svn: 295786
* [mips] Define macros related to -mabicalls in the preprocessorSimon Dardis2017-02-211-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Historically, NetBSD, FreeBSD and OpenBSD have defined the macro ABICALLS in the preprocessor when -mabicalls is in effect. Mainline GCC later defined __mips_abicalls when -mabicalls is in effect. This patch teaches the preprocessor to define these macros when appropriate. NetBSD does not require the ABICALLS macro. This resolves PR/31694. Thanks to Sean Bruno for highlighting this issue! Reviewers: slthakur, seanbruno Reviewed By: seanbruno Subscribers: joerg, brad, emaste, seanbruno, cfe-commits Differential Revision: https://reviews.llvm.org/D29032 llvm-svn: 295728
* Add a definition for __STRUCT_PARM_ALIGN__ for elfv2 and 64-bit darwin ↵Eric Christopher2017-02-151-0/+1
| | | | | | platforms to match what other compilers produce. llvm-svn: 295156
* Add check that "#define unix 1" is present for the PS4 target.Douglas Yung2017-02-091-0/+1
| | | | llvm-svn: 294534
* Revert "Basic: match GCC behaviour for SuS macro"Saleem Abdulrasool2017-02-071-0/+3
| | | | | | | This reverts commit SVN r294148. Seems that it was mistaken, and GCC does still define `__unix` and `unix` when in GNU mode. llvm-svn: 294332
* Basic: match GCC behaviour for SuS macroSaleem Abdulrasool2017-02-051-3/+0
| | | | | | | | GCC does not generate `__unix` nor `unix` macros. The latter already intrudes into the user's namespace and should be avoided. Use the canonical spelling of `__unix__` across all the targets. llvm-svn: 294148
* [Frontend] The macro that describes the Objective-C bool type shouldAlex Lorenz2017-01-201-0/+2
| | | | | | | | | | be defined for non Objective-C code as well rdar://29794915 Differential Revision: https://reviews.llvm.org/D28349 llvm-svn: 292617
* Add AVR target and toolchain to ClangDylan McKay2017-01-051-0/+171
| | | | | | | | | | | | | | | | | Summary: Authored by Senthil Kumar Selvaraj This patch adds barebones support in Clang for the (experimental) AVR target. It uses the integrated assembler for assembly, and the GNU linker for linking, as lld doesn't know about the target yet. The DataLayout string is the same as the one in AVRTargetMachine.cpp. The alignment specs look wrong to me, as it's an 8 bit target and all types only need 8 bit alignment. Clang failed with a datalayout mismatch error when I tried to change it, so I left it that way for now. Reviewers: rsmith, dylanmckay, cfe-commits, rengolin Subscribers: rengolin, jroelofs, wdng Differential Revision: https://reviews.llvm.org/D27123 llvm-svn: 291082
* Also recognize -std=iso9899:201xBenjamin Kramer2016-12-061-0/+3
| | | | | | | | | | | It should already be handled but a typo in the LANGSTANDARD() definition was introduced in r147220. Patch by Alexander Richardson, test case by me. Differential Revision:https://reviews.llvm.org/D27427 llvm-svn: 288793
* Add a new optimization option -Og Sylvestre Ledru2016-11-111-0/+6
| | | | | | | | | | | | | | Summary: Just like gcc, we should have the -Og option as more and more software are using it: https://llvm.org/bugs/show_bug.cgi?id=20765 Reviewers: echristo, dberlin, dblaikie, keith.walker.arm, rengolin Subscribers: aprantl, friss, mehdi_amini, RKSimon, probinson, majnemer, cfe-commits Differential Revision: https://reviews.llvm.org/D24998 llvm-svn: 286602
* Define __ANDROID_API__ when specified as part of an Android target.Stephen Hines2016-11-111-0/+5
| | | | | | | | | | | | | | | | | Summary: This macro should be defined only when the user directly specifies an API level as part of an Android target. For any regular Android target, we leave this macro undefined. Bug: https://llvm.org/bugs/show_bug.cgi?id=30940 Reviewers: eugenis, pirama Subscribers: tberghammer, cfe-commits, pirama, eugenis, danalbert Differential Revision: https://reviews.llvm.org/D26491 llvm-svn: 286543
* [Sparc] LLONG is not lock-free atomic on v8Douglas Katzman2016-11-091-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D26286 llvm-svn: 286376
* P0035R4: add predefined __STDCPP_DEFAULT_NEW_ALIGNMENT__ macro. By default, weRichard Smith2016-09-301-5/+49
| | | | | | | | | assume that ::operator new provides no more alignment than is necessary for any primitive type, except when we're on a GNU OS, where glibc's malloc guarantees to provide 64-bit alignment on 32-bit systems and 128-bit alignment on 64-bit systems. This can be controlled by the command-line -fnew-alignment flag. llvm-svn: 282974
* [OpenBSD] Add type sign information for OpenBSDRenato Golin2016-09-221-0/+23
| | | | | | | | | | | | | | Like NetBSD, OpenBSD prefers having a consistent set of typedefs across the architectures it supports over strictly following the ARM ABIs. The diff below makes sure that clang's view of those types matches OpenBSD's system header files. It also adds a test that checks the relevant types on all OpenBSD platforms that clang works on. Hopefully we can add mips64 and powerpc to that list in the future. Patch by Mark Kettenis <mark.kettenis@xs4all.nl> llvm-svn: 282184
* OpenCL: Defining __ENDIAN_LITTLE__ and fix target endiannessMatt Arsenault2016-09-071-0/+1
| | | | | | | | | OpenCL requires __ENDIAN_LITTLE__ be set for little endian targets. The default for targets was also apparently big endian, so AMDGPU was incorrectly reported as big endian. Set this from the triple so targets don't have another place to set the endianness. llvm-svn: 280787
* Add support for targeting armv6-unknown-cloudabi-eabihf.Ed Schouten2016-09-051-0/+5
| | | | | | | I'm in the progress of adding ARMv6 support to CloudABI. On the compiler side, everything seems to work properly with this tiny change applied. llvm-svn: 280672
* [WebAssembly] Change wasm SizeType to match asmjsDerek Schuff2016-09-011-20/+20
| | | | | | | | | | | | | | | | Summary: We want wasm and asmjs to have matching ABIs, and right now asmjs uses unsigned int for its size_t. This causes exported symbols in libcxx to not match and can cause weird breakage where libcxx doesn't get linked as a result. Long-term we probably want wasm32, wasm64, and asmjs to all use unsigned long, but that would cause unnecessary ABI churn for asmjs so defer that until we can make all the ABI changes at once. Patch by Jacob Gravelle Differential Revision: https://reviews.llvm.org/D24134 llvm-svn: 280420
* [PS4] Change the names of some "environmental" things to what ourPaul Robinson2016-05-161-1/+1
| | | | | | | | licensees actually see in the toolchain we deliver to them. This will reduce the set of local patches we have to maintain. The triple is not changing. (The term ORBIS is an internal code name for PS4.) llvm-svn: 269671
* ARM-MachO: stop claiming to be EABITim Northover2016-05-131-7/+7
| | | | | | | | | | Embedded ARM MachO targets are AAPCS but not full EABI (we don't use __aeabi_whatever and the functions are allowed to be hard-float). Turns out there was already a test for this, but its original purpose had become corrupted over the years. llvm-svn: 269487
OpenPOWER on IntegriCloud