summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor
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)
* [Lexer] Allow UCN for dollar symbol '\u0024' in identifiers when using ↵Scott Egerton2020-01-151-2/+1
| | | | | | | | | | | | | | | | | | | | -fdollars-in-identifiers flag. Summary: Previously, the -fdollars-in-identifiers flag allows the '$' symbol to be used in an identifier but the universal character name equivalent '\u0024' is not allowed. This patch changes this, so that \u0024 is valid in identifiers. Reviewers: rsmith, jordan_rose Reviewed By: rsmith Subscribers: dexonsmith, simoncook, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71758
* Revert "[RISCV] Add Clang frontend support for Bitmanip extension"Scott Egerton2020-01-151-7/+0
| | | | This reverts commit 57cf6ee9c84434161088c39a6f8dd2aae14eb12d.
* [RISCV] Add Clang frontend support for Bitmanip extensionScott Egerton2020-01-141-0/+7
| | | | | | | | | | | | | | Summary: This adds the __riscv_bitmanip macro and the 'b' target feature to enable it. Reviewers: asb, simoncook, lewis-revill, PaoloS, lenary Reviewed By: lenary Subscribers: Jim, rbar, johnrusso, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71553
* [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
* AArch64: add missing Apple CPU names and use them by default.Tim Northover2020-01-081-4/+17
| | | | | | | | Apple's CPUs are called A7-A13 in official communication, occasionally with weird suffixes which we probably don't need to care about. This adds each one and describes its features. It also switches the default CPU to the canonical name for Cyclone, but leaves legacy support in so that existing bitcode still compiles.
* [PowerPC][Triple] Use elfv2 on freebsd>=13 and linux-muslFangrui Song2020-01-071-0/+6
| | | | | | | | | | | | | | | | | | | Summary: Every powerpc64le platform uses elfv2. For powerpc64, the environments "elfv1" and "elfv2" were added for FreeBSD ELFv1->ELFv2 migration in D61950. FreeBSD developers have decided to use OS versions to select ABI, and no one is relying on the environments. Also use elfv2 on powerpc64-linux-musl. Users can always use -mabi=elfv1 and -mabi=elfv2 to override the default ABI. Reviewed By: adalava Differential Revision: https://reviews.llvm.org/D72352
* [test] Move ppc64 tests from test/Preprocessor/init.c to init-ppc64.cFangrui Song2020-01-072-1072/+1068
|
* [PS4] Predefine the __SCE__ macro for the x86_64-scei-ps4 tripleWarren Ristow2019-12-121-0/+1
|
* Bug 43965 - Value of _MSVC_LANG doesn't match MSVC++ VS2019 /std:c++latest modeSoumi Manna2019-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The patch adds correct value of _MSVC_LANG to match with MSVC++ VS2019 /std:c++latest mode. Bugzilla - Bug 43965 https://bugs.llvm.org/show_bug.cgi?id=43965 The value for a MS specific macro differs from Microsoft starting with VS2019 in /std:c++latest mode. -bash-4.2$ cat msvclang.cpp _MSVC_LANG -bash-4.2$ cl /std:c++latest -E msvclang.cpp Microsoft (R) C/C++ Optimizing Compiler Version 19.20.27508.1 for x64 Copyright (C) Microsoft Corporation. All rights reserved. /std:c++latest is provided as a preview of language features from the latest C++ working draft, and we're eager to hear about bugs and suggestions for improvements. However, note that these features are provided as-is without support, and subject to changes or removal as the working draft evolves. See https://go.microsoft.com/fwlink/?linkid=2045807 for details. msvclang.cpp 201705L -bash-4.2$ clang-cl /std:c++latest -E msvclang.cpp 201704L Reviewers: rnk Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D70996
* [Diagnostic][test] Remove an unneeded change to ↵Fangrui Song2019-12-031-1/+1
| | | | pragma_diagnostic_sections.cpp after D70638
* [Diagnostic] add a warning which warns about misleading indentationTyker2019-12-031-1/+1
| | | | | | | | | | | | | | Summary: Add a warning for misleading indentation similar to GCC's -Wmisleading-indentation Reviewers: aaron.ballman, xbolva00 Reviewed By: aaron.ballman, xbolva00 Subscribers: tstellar, cfe-commits, arphaman, Ka-Ka, thakis Tags: #clang Differential Revision: https://reviews.llvm.org/D70638
* XFAIL a test on WindowsFangrui Song2019-11-261-0/+1
| | | | | | | | | | | | http://45.33.8.238/win/3052/step_6.txt C:\src\llvm-project\clang\test\Preprocessor\file_test.c:9:11: error: CHECK: expected string not found in input // CHECK: filename: "/UNLIKELY_PATH/empty{{/|\\\\}}file_test.c" ^ <stdin>:1:1: note: scanning from here ^ <stdin>:1:28: note: possible intended match here ^
* [Preprocessor] Fix backslash tests on Windows after D49466Fangrui Song2019-11-261-6/+6
| | | | See http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/29442/steps/test-check-all/logs/stdio
* Initial implementation of -fmacro-prefix-map and -ffile-prefix-mapDan McGregor2019-11-262-0/+24
| | | | | | | | | GCC 8 implements -fmacro-prefix-map. Like -fdebug-prefix-map, it replaces a string prefix for the __FILE__ macro. -ffile-prefix-map is the union of -fdebug-prefix-map and -fmacro-prefix-map Reviewed By: rnk, Lekensteyn, maskray Differential Revision: https://reviews.llvm.org/D49466
* Disallow use of __has_c_attribute in C++ mode.Aaron Ballman2019-11-252-0/+14
| | | | | | | __has_cpp_attribute is not available in C mode, and __has_c_attribute should not be available in C++ mode. This also adds a test to demonstrate that we properly handle scoped attribute tokens even in C mode.
* Revert "[Diagnostic] add a warning which warns about misleading indentation"Tom Stellard2019-11-251-1/+1
| | | | | | This reverts commit 7b86188b50bf6e537fe98b326f258fbd23108b83. This commit introduced bot falures for multi-stage bots with -Werror.
* [Diagnostic] add a warning which warns about misleading indentationTyker2019-11-251-1/+1
| | | | | | | | | | | | Summary: Add a warning for misleading indentation similar to GCC's -Wmisleading-indentation Reviewers: aaron.ballman, xbolva00 Reviewed By: aaron.ballman, xbolva00 Subscribers: arphaman, Ka-Ka, thakis Differential Revision: https://reviews.llvm.org/D70638
* [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
* AArch64: add arm64_32 support to Clang.Tim Northover2019-11-124-0/+116
|
* [mips] Set macros for Octeon+ CPUSimon Atanasyan2019-11-071-0/+10
|
* [X86] Add 'fxsr' feature to -march=pentium2 to match X86.td and gcc.Craig Topper2019-11-061-0/+1
|
* [X86] Add 'mmx' to all CPUs that have a version of 'sse' and weren't already ↵Craig Topper2019-11-061-3/+11
| | | | | | | | | | | | | | enabling '3dnow' All SSE capable CPUs have MMX. 3dnow implicitly enables MMX. We have code that detects if sse is enabled and implicitly enables MMX unless -mno-mmx is passed. So in most cases we were already enabling MMX if march passed a CPU that supported SSE. The exception to this is if you pass -march for a cpu supports SSE and also pass -mno-sse. We should still enable MMX since its part of the CPU capability.
* [mips] Set __OCTEON__ macrosSimon Atanasyan2019-11-051-0/+1
|
* [mips] Fix `__mips_isa_rev` macros value for Octeon CPUSimon Atanasyan2019-11-051-0/+9
|
* [ms] Fix Microsoft compatibility handling of commas in nested macro expansions.Eric Astor2019-11-041-0/+13
| | | | | | | | | | | | | | | | | | | In Microsoft-compatibility mode, single commas from nested macro expansions should not be considered as argument separators; we already emulated this by marking them to be ignored. However, in MSVC's preprocessor, subsequent expansions DO treat these commas as argument separators... so we now ignore each comma at most once. Includes a small unit test that validates we match MSVC's behavior as shown in https://gcc.godbolt.org/z/y0twaq Fixes PR43282 Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69626
* [clang][llvm] Obsolete Exynos M1 and M2Evandro Menezes2019-10-302-10/+0
|
* Accept __is_same_as as a GCC-compatibility synonym for the proper trait name ↵Richard Smith2019-10-291-0/+1
| | | | __is_same.
* 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
* Fix for expanding __pragmas in macro argumentsAmy Huang2019-10-071-1/+11
| | | | | | | | | | | | | | | | | Summary: Avoid parsing __pragma into an annotation token when macro arguments are pre-expanded. This is what clang currently does when parsing _Pragmas. Fixes https://bugs.llvm.org/show_bug.cgi?id=41128, where clang crashed when trying to get the length of an annotation token. Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68114 llvm-svn: 373950
* [test] Use %clang_cc1 instead of %clang -cc1Fangrui Song2019-09-271-3/+3
| | | | llvm-svn: 373043
* [SystemZ] Support z15 processor nameUlrich Weigand2019-09-201-0/+3
| | | | | | | | | | The recently announced IBM z15 processor implements the architecture already supported as "arch13" in LLVM. This patch adds support for "z15" as an alternate architecture name for arch13. Corrsponding LLVM support was committed as rev. 372435. llvm-svn: 372436
* [RISCV] Add option aliases: -mcmodel=medany and -mcmodel=medlowKito Cheng2019-09-171-0/+10
| | | | | | | | | | | | | | RISC-V GCC use -mcmodel=medany and -mcmodel=medlow, but LLVM use -mcmodel=small and -mcmodel=medium. Add those two option aliases for provide same user interface between GCC and LLVM. Reviewed By: lenary Differential Revision: https://reviews.llvm.org/D67066 llvm-svn: 372080
* [RISCV] Define __riscv_cmodel_medlow and __riscv_cmodel_medany correctlyKito Cheng2019-09-171-0/+20
| | | | | | | | | | | | | | RISC-V LLVM was only implement small/medlow code model, so it defined __riscv_cmodel_medlow directly without check. Now, we have medium/medany code model in RISC-V back-end, it should define according the actually code model. Reviewed By: lewis-revill Differential Revision: https://reviews.llvm.org/D67065 llvm-svn: 372078
* Fix up a test updated in r371655 - require case-insensitive file system.Volodymyr Sapsai2019-09-111-0/+1
| | | | | | | On case-sensitive file systems include with wrong case is not found instead of showing a warning. llvm-svn: 371665
* Fix -Wnonportable-include-path suppression for header maps with absolute paths.Volodymyr Sapsai2019-09-114-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | In `DirectoryLookup::LookupFile` parameter `HasBeenMapped` doesn't cover the case when clang finds a file through a header map but doesn't remap the lookup filename because the target path is an absolute path. As a result, -Wnonportable-include-path suppression for header maps introduced in r301592 wasn't triggered. Change parameter `HasBeenMapped` to `IsInHeaderMap` and use parameter `MappedName` to track the filename remapping. This way we can handle both relative and absolute paths in header maps, and account for their specific properties, like filename remapping being a property preserved across lookups in multiple directories. rdar://problem/39516483 Reviewers: dexonsmith, bruno Reviewed By: dexonsmith Subscribers: jkorous, cfe-commits, ributzka Differential Revision: https://reviews.llvm.org/D58094 llvm-svn: 371655
* [RISCV] Default to ilp32d/lp64d in RISC-V LinuxRoger Ferrer Ibanez2019-09-101-4/+4
| | | | | | | | | | When running clang as a native compiler in RISC-V Linux the flag -mabi=ilp32d / -mabi=lp64d is always mandatory. This change makes it the default there. Differential Revision: https://reviews.llvm.org/D65634 llvm-svn: 371494
* 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
* [X86] Remove what little support we had for MPXCraig Topper2019-08-291-22/+0
| | | | | | | | | | | | | | | -Deprecate -mmpx and -mno-mpx command line options -Remove CPUID detection of mpx for -march=native -Remove MPX from all CPUs -Remove MPX preprocessor define I've left the "mpx" string in the backend so we don't fail on old IR, but its not connected to anything. gcc has also deprecated these command line options. https://www.phoronix.com/scan.php?page=news_item&px=GCC-Patch-To-Drop-MPX Differential Revision: https://reviews.llvm.org/D66669 llvm-svn: 370393
* Allow standards-based attributes to have leading and trailing underscores.Aaron Ballman2019-08-152-0/+7
| | | | | | This gives library implementers a way to use standards-based attributes that do not conflict with user-defined macros of the same name. Attributes in C2x require this behavior normatively (C2x 6.7.11p4), but there's no reason to not have the same behavior in C++, especially given that such attributes may be used by a C library consumed by a C++ compilation. llvm-svn: 369033
* Add __has_builtin support for builtin function-like type traits.Richard Smith2019-08-142-1/+52
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously __has_builtin(__builtin_*) would return false for __builtin_*s that we modeled as keywords rather than as functions (because they take type arguments). With this patch, all builtins that are called with function-call-like syntax return true from __has_builtin (covering __builtin_* and also the __is_* and __has_* type traits and the handful of similar builtins without such a prefix). Update the documentation on __has_builtin and on type traits to match. While doing this I noticed the type trait documentation was out of date and incomplete; that's fixed here too. Reviewers: aaron.ballman Subscribers: jfb, kristina, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66100 llvm-svn: 368785
* [X86] Support -march=tigerlakePengfei Wang2019-08-121-0/+127
| | | | | | | | | | | | Support -march=tigerlake for x86. Compare with Icelake Client, It include 4 more new features ,they are avx512vp2intersect, movdiri, movdir64b, shstk. Patch by Xiang Zhang (xiangzhangllvm) Differential Revision: https://reviews.llvm.org/D65840 llvm-svn: 368543
* Don't diagnose errors when a file matches an include componentReid Kleckner2019-08-093-0/+5
| | | | | | | | | This regressed in r368322, and was reported as PR42948 and on the mailing list. The fix is to ignore the specific error code for this case. The problem doesn't seem to reproduce on Windows, where a different error code is used instead. llvm-svn: 368475
* [Preprocessor] Always discard body of #define if we failed to parse itIlya Biryukov2019-08-011-0/+5
| | | | | | | | | | | | | | | | | | | | Summary: Preivously we would only discard it if we failed to parse parameter lists. If we do not consume the body, parser sees tokens inside directive. In turn, this leads to spurious diagnostics and a crash in TokenBuffer, see the added tests. Reviewers: sammccall Reviewed By: sammccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65517 llvm-svn: 367530
* [AArch64] Disable __ARM_FEATURE_SVE without ACLE.Sander de Smalen2019-07-301-1/+1
| | | | | | | | | | | | | | | | | The Arm C Language Extensions for SVE document specifies that __ARM_FEATURE_SVE should be set when the compiler supports SVE and implements all the extensions described in the document. This is currently not yet the case, so the feature should be disabled until the compiler can provide all the extensions as described. Reviewers: c-rhodes, rengolin, rovka, ktkachov Reviewed By: rengolin Differential Revision: https://reviews.llvm.org/D65404 llvm-svn: 367301
* Implement P1771Erich Keane2019-07-251-1/+1
| | | | | | | | | | | | | As passed in the Cologne meeting and treated by Core as a DR, [[nodiscard]] was applied to constructors so that they can be diagnosed in cases where the user forgets a variable name for a type. The intent is to enable the library to start using this on the constructors of scope_guard/lock_guard. Differential Revision: https://reviews.llvm.org/D64914 llvm-svn: 367027
* [OpenCL] Rename lang mode flag for C++ modeAnastasia Stulova2019-07-251-1/+1
| | | | | | | | | | | | Rename lang mode flag to -cl-std=clc++/-cl-std=CLC++ or -std=clc++/-std=CLC++. This aligns with OpenCL C conversion and removes ambiguity with OpenCL C++. Differential Revision: https://reviews.llvm.org/D65102 llvm-svn: 367008
* [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
OpenPOWER on IntegriCloud