summaryrefslogtreecommitdiffstats
path: root/clang/test/Lexer
Commit message (Collapse)AuthorAgeFilesLines
...
* Driver: hoist the `wchar_t` handling to the driverSaleem Abdulrasool2017-10-061-1/+1
| | | | | | | | | | | | | | | | Move the logic for determining the `wchar_t` type information into the driver. Rather than passing the single bit of information of `-fshort-wchar` indicate to the frontend the desired type of `wchar_t` through a new `-cc1` option of `-fwchar-type` and indicate the signedness through `-f{,no-}signed-wchar`. This replicates the current logic which was spread throughout Basic into the `RenderCharacterOptions`. Most of the changes to the tests are to ensure that the frontend uses the correct type. Add a new test set under `test/Driver/wchar_t.c` to ensure that we calculate the proper types for the various cases. llvm-svn: 315126
* Recommit "Add _Float16 as a C/C++ source language type"Sjoerd Meijer2017-09-081-0/+3
| | | | | | | | This is a recommit of r312781; in some build configurations variable names are omitted, so changed the new regression test accordingly. llvm-svn: 312794
* Revert "Add _Float16 as a C/C++ source language type"Sjoerd Meijer2017-09-081-3/+0
| | | | | | | The clang-with-lto-ubuntu bot didn't like the new regression test, revert while I investigate the issue. llvm-svn: 312784
* Add _Float16 as a C/C++ source language typeSjoerd Meijer2017-09-081-0/+3
| | | | | | | | | | | This adds _Float16 as a source language type, which is a 16-bit floating point type defined in C11 extension ISO/IEC TS 18661-3. In follow up patches documentation and more tests will be added. Differential Revision: https://reviews.llvm.org/D33719 llvm-svn: 312781
* Add missing test for warning added in r310803.Richard Smith2017-08-161-0/+9
| | | | llvm-svn: 310978
* [clang] Get rid of "%T" expansionsKuba Mracek2017-08-154-20/+20
| | | | | | | | | | The %T lit expansion expands to a common directory shared between all the tests in the same directory, which is unexpected and unintuitive, and more importantly, it's been a source of subtle race conditions and flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it would be best to simply ban %T and only keep %t, which is unique to each test. When a test needs a temporary directory, it can just create one using mkdir %t. This patch removes %T in clang. Differential Revision: https://reviews.llvm.org/D36437 llvm-svn: 310950
* Replace remaining user-visible mentions of C++1z with C++17.Richard Smith2017-08-131-5/+5
| | | | llvm-svn: 310804
* [c++2a] Treat 'concept' and 'requires' as keywords, add compat warning for ↵Richard Smith2017-08-131-1/+2
| | | | | | C++17 and before. llvm-svn: 310803
* Implement latest feature test macro recommendations, P0096R4.Richard Smith2017-08-111-7/+11
| | | | llvm-svn: 310694
* Revert "Lexer: always allow imaginary constants in GNU mode."Tim Northover2017-08-081-25/+0
| | | | | | | This reverts r310423. It was committed by mistake, I intended to commit the improved diagnostics for implicit conversions instead. llvm-svn: 310426
* Lexer: always allow imaginary constants in GNU mode.Tim Northover2017-08-081-0/+25
| | | | llvm-svn: 310423
* Reorder tests to match latest SD-6 draft.Richard Smith2017-07-251-8/+8
| | | | llvm-svn: 309054
* Allow for unfinished #if blocks in preamblesErik Verbruggen2017-05-302-6/+24
| | | | | | | | | | | | | | | | | | | Previously, a preamble only included #if blocks (and friends like ifdef) if there was a corresponding #endif before any declaration or definition. The problem is that any header file that uses include guards will not have a preamble generated, which can make code-completion very slow. To prevent errors about unbalanced preprocessor conditionals in the preamble, and unbalanced preprocessor conditionals after a preamble containing unfinished conditionals, the conditional stack is stored in the pch file. This fixes PR26045. Differential Revision: http://reviews.llvm.org/D15994 llvm-svn: 304207
* [coroutines] Bump __cpp_coroutines versionEric Fiselier2017-05-251-1/+1
| | | | | | | | | | | | | | Summary: This patch is needed so that Libc++ can actually tess if Clang supports coroutines, instead of just paying lip service with a partial implementation. Otherwise the libc++ test suite will fail against older versions of Clang Reviewers: GorNishanov, rsmith Reviewed By: GorNishanov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33536 llvm-svn: 303867
* Do not warn about whitespace between ??/ trigraph and newline in line ↵Richard Smith2017-04-181-1/+6
| | | | | | comments if trigraphs are disabled in the current language. llvm-svn: 300609
* Fix mishandling of escaped newlines followed by newlines or nuls.Richard Smith2017-04-171-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, if an escaped newline was followed by a newline or a nul, we'd lex the escaped newline as a bogus space character. This led to a bunch of different broken corner cases: For the pattern "\\\n\0#", we would then have a (horizontal) space whose spelling ends in a newline, and would decide that the '#' is at the start of a line, and incorrectly start preprocessing a directive in the middle of a logical source line. If we were already in the middle of a directive, this would result in our attempting to process multiple directives at the same time! This resulted in crashes, asserts, and hangs on invalid input, as discovered by fuzz-testing. For the pattern "\\\n" at EOF (with an implicit following nul byte), we would produce a bogus trailing space character with spelling "\\\n". This was mostly harmless, but would lead to clang-format getting confused and misformatting in rare cases. We now produce a trailing EOF token with spelling "\\\n", consistent with our handling for other similar cases -- an escaped newline is always part of the token containing the next character, if any. For the pattern "\\\n\n", this was somewhat more benign, but would produce an extraneous whitespace token to clients who care about preserving whitespace. However, it turns out that our lexing for line comments was relying on this bug due to an off-by-one error in its computation of the end of the comment, on the slow path where the comment might contain escaped newlines. llvm-svn: 300515
* Skip Unicode character expansion in assembly filesSanne Wouda2017-04-071-0/+8
| | | | | | | | | | | | | | | | | | | Summary: When using the C preprocessor with assembly files, either with a capital `S` file extension, or with `-xassembler-with-cpp`, the Unicode escape sequence `\u` is ignored. The `\u` pattern can be used for expanding a macro argument that starts with `u`. Author: Salman Arif <salman.arif@arm.com> Reviewers: rengolin, olista01 Reviewed By: olista01 Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31765 llvm-svn: 299754
* [c++1z] Mark constexpr lambdas as done on status page and start advertisingRichard Smith2017-02-211-2/+2
| | | | | | | | them via feature test macro __cpp_constexpr. Thanks to Faisal for implementing this feature! llvm-svn: 295791
* Fix for pr31836 - pp_nonportable_path on absolute paths: broken delimitersTaewook Oh2017-02-211-0/+9
| | | | | | | | | | | | | | Summary: This is a patch for PR31836. As the bug replaces the path separators in the included file name with the characters following them, the test script makes sure that there's no "Ccase-insensitive-include-pr31836.h" in the warning message. Reviewers: rsmith, eric_niebler Reviewed By: eric_niebler Subscribers: karies, cfe-commits Differential Revision: https://reviews.llvm.org/D30000 llvm-svn: 295779
* [c++1z] Add some more tests for class template argument deduction, addRichard Smith2017-02-141-0/+8
| | | | | | feature-test macro, and mark feature as done on status page. llvm-svn: 295011
* P0426: Make the library implementation of constexpr char_traits a little easierRichard Smith2017-01-201-0/+11
| | | | | | | | | by providing a memchr builtin that returns char* instead of void*. Also add a __has_feature flag to indicate the presence of constexpr forms of the relevant <string> functions. llvm-svn: 292555
* Add __cpp_structured_bindings feature test macro for structured bindings, perRichard Smith2016-12-191-1/+5
| | | | | | latest (provisional) draft of SD-6. llvm-svn: 290082
* [c++1z] cxx_status: mark p0195r2 as done.Richard Smith2016-12-191-2/+5
| | | | llvm-svn: 290081
* p0012r1: define corresponding feature test macroRichard Smith2016-12-021-2/+1
| | | | llvm-svn: 288452
* Mark aligned allocation as done.Richard Smith2016-10-101-2/+1
| | | | llvm-svn: 283724
* [coroutines] Rename driver flag -fcoroutines to -fcoroutines-tsGor Nishanov2016-10-022-2/+2
| | | | | | | | | | | | | | | Summary: Also makes -fcoroutines_ts to be both a Driver and CC1 flag. Patch mostly by EricWF. Reviewers: rnk, cfe-commits, rsmith, EricWF Subscribers: mehdi_amini Differential Revision: https://reviews.llvm.org/D25130 llvm-svn: 283064
* Mark P0127R3 as done, and replace its __has_feature check with the ↵Richard Smith2016-09-291-2/+1
| | | | | | corresponding SD-6 macro. llvm-svn: 282652
* Add a couple more tentative names for upcoming SD-6 feature checks. These mightRichard Smith2016-09-281-0/+21
| | | | | | | not reflect the final chosen names, but supporting them now seems to have little downside. llvm-svn: 282629
* P0095R3: Implement the latest published revision of SD-6 (C++ feature test ↵Richard Smith2016-09-281-3/+19
| | | | | | macros). llvm-svn: 282627
* P0096R2: Implement more recent revision of SD-6 (C++ feature test macros).Richard Smith2016-09-281-12/+63
| | | | llvm-svn: 282622
* Add -fmodules-ts flag to cc1 for the provisional C++ modules TS, and markRichard Smith2016-07-231-0/+11
| | | | | | 'module' and 'import' as keywords when the flag is specified. llvm-svn: 276508
* Use the name of the file on disk to issue a new diagnostic about ↵Taewook Oh2016-06-134-0/+71
| | | | | | | | | | | non-portable #include and #import paths. Differential Revision: http://reviews.llvm.org/D19843 Corresponding LLVM change: http://reviews.llvm.org/D19842 Re-commit of r272562 after addressing clang-x86-win2008-selfhost failure. llvm-svn: 272584
* Revert r272562 for build bot failure (clang-x86-win2008-selfhost)Taewook Oh2016-06-134-71/+0
| | | | llvm-svn: 272572
* Use the name of the file on disk to issue a new diagnostic about ↵Taewook Oh2016-06-134-0/+71
| | | | | | | | | | | | | non-portable #include and #import paths. Differential Revision: http://reviews.llvm.org/D19843 Corresponding LLVM change: http://reviews.llvm.org/D19842 Re-commit after addressing issues with of generating too many warnings for Windows and asan test failures. Patch by Eric Niebler llvm-svn: 272562
* Revert commit r271708Taewook Oh2016-06-043-50/+0
| | | | llvm-svn: 271761
* Use the name of the file on disk to issue a new diagnostic about ↵Taewook Oh2016-06-033-0/+50
| | | | | | | | | | | non-portable #include and #import paths. Differential Revision: http://reviews.llvm.org/D19843 Corresponding LLVM change: http://reviews.llvm.org/D19842 Patch by Eric Niebler llvm-svn: 271708
* [esan|wset] Add working set tool driver flagsDerek Bruening2016-05-251-0/+1
| | | | | | | | | | | | | | Summary: Adds a new -fsanitize=efficiency-working-set flag to enable esan's working set tool. Adds appropriate tests for the new flag. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits Differential Revision: http://reviews.llvm.org/D20484 llvm-svn: 270641
* Revert "[Lex] Support more type-traits in __has_feature"David Majnemer2016-05-241-25/+0
| | | | | | | This reverts commit r270580. Using __has_feature to test for type-traits is deprecated. llvm-svn: 270583
* [Lex] Support more type-traits in __has_featureDavid Majnemer2016-05-241-0/+20
| | | | | | | It looks like we forgot to update the __has_feature support when we added some of the type traits. llvm-svn: 270580
* Clang support for __is_assignable intrinsicDavid Majnemer2016-05-231-0/+5
| | | | | | | | | | | | | | | | | | | MSVC now supports the __is_assignable type trait intrinsic, to enable easier and more efficient implementation of the Standard Library's is_assignable trait. As of Visual Studio 2015 Update 3, the VC Standard Library implementation uses the new intrinsic unconditionally. The implementation is pretty straightforward due to the previously existing is_nothrow_assignable and is_trivially_assignable. We handle __is_assignable via the same code as the other two except that we skip the extra checks for nothrow or triviality. Patch by Dave Bartolomeo! Differential Revision: http://reviews.llvm.org/D20492 llvm-svn: 270458
* [OpenCL] Add supported OpenCL extensions to target info.Yaxun Liu2016-05-161-1/+1
| | | | | | | | | | Add supported OpenCL extensions to target info. It serves as default values to save the users of the burden setting each supported extensions and optional core features in command line. Re-commit after fixing build error due to missing override attribute. Differential Revision: http://reviews.llvm.org/D19484 llvm-svn: 269670
* Revert "[OpenCL] Add supported OpenCL extensions to target info."Yaxun Liu2016-05-131-1/+1
| | | | | | | | | Revert r269431 due to build failure caused by warning msg: llvm/tools/clang/lib/Basic/Targets.cpp:2090:9: error: 'setSupportedOpenCLOpts' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] void setSupportedOpenCLOpts() { llvm-svn: 269435
* [OpenCL] Add supported OpenCL extensions to target info.Yaxun Liu2016-05-131-1/+1
| | | | | | | | Add supported OpenCL extensions to target info. It serves as default values to save the users of the burden setting each supported extensions and optional core features in command line. Differential Revision: http://reviews.llvm.org/D19484 llvm-svn: 269431
* [esan] EfficiencySanitizer driver flagsDerek Bruening2016-04-211-0/+11
| | | | | | | | | | | | | | | | Summary: Adds a framework to enable the instrumentation pass for the new EfficiencySanitizer ("esan") family of tools. Adds a flag for esan's cache fragmentation tool via -fsanitize=efficiency-cache-frag. Adds appropriate tests for the new flag. Reviewers: eugenis, vitalybuka, aizatsky, filcab Subscribers: filcab, kubabrecka, llvm-commits, zhaoqin, kcc Differential Revision: http://reviews.llvm.org/D19169 llvm-svn: 267059
* [Lexer] Don't read out of bounds if a conflict marker is at the end of a fileBenjamin Kramer2016-04-011-0/+11
| | | | | | | | | | This can happen as we look for '<<<<' while scanning tokens but then expect '<<<<\n' to tell apart perforce from diff3 conflict markers. Just harden the pointer arithmetic. Found by libfuzzer + asan! llvm-svn: 265125
* Update cxx-features test to C++1zJF Bastien2016-03-221-34/+38
| | | | | | | Forked from the following patch: http://reviews.llvm.org/D17950 llvm-svn: 264098
* Update diagnostics now that hexadecimal literals look likely to be part of ↵Richard Smith2016-03-042-9/+25
| | | | | | C++17. llvm-svn: 262753
* [OpenCL] Added half type literal with suffix h.Anastasia Stulova2016-02-172-0/+13
| | | | | | | | | | | | | OpenCL Extension v1.2 s9.5 allows half precision floating point type literals with suffices h or H when cl_khr_fp16 is enabled. Example: half x = 1.0h; Patch by Liu Yaxun (Sam)! Differential Revision: http://reviews.llvm.org/D16865 llvm-svn: 261084
* PR26349: correctly check whether a digit sequence is empty in the presence ↵Richard Smith2016-02-091-0/+3
| | | | | | of digit separators. llvm-svn: 260307
* Add -Wexpansion-to-undefined: warn when using `defined` in a macro definition.Nico Weber2016-01-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [cpp.cond]p4: Prior to evaluation, macro invocations in the list of preprocessing tokens that will become the controlling constant expression are replaced (except for those macro names modified by the 'defined' unary operator), just as in normal text. If the token 'defined' is generated as a result of this replacement process or use of the 'defined' unary operator does not match one of the two specified forms prior to macro replacement, the behavior is undefined. This isn't an idle threat, consider this program: #define FOO #define BAR defined(FOO) #if BAR ... #else ... #endif clang and gcc will pick the #if branch while Visual Studio will take the #else branch. Emit a warning about this undefined behavior. One problem is that this also applies to function-like macros. While the example above can be written like #if defined(FOO) && defined(BAR) #defined HAVE_FOO 1 #else #define HAVE_FOO 0 #endif there is no easy way to rewrite a function-like macro like `#define FOO(x) (defined __foo_##x && __foo_##x)`. Function-like macros like this are used in practice, and compilers seem to not have differing behavior in that case. So this a default-on warning only for object-like macros. For function-like macros, it is an extension warning that only shows up with `-pedantic`. (But it's undefined behavior in both cases.) llvm-svn: 258128
OpenPOWER on IntegriCloud