summaryrefslogtreecommitdiff
path: root/test/Lexer
Commit message (Collapse)AuthorAge
* Make MS i128 suffix test from r211446 more robustAlp Toker2014-06-21
| | | | | | We want to catch both negative and positive failure conditions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211449 91177308-0d34-0410-b5e6-96231b3b80d8
* The i128 suffix isn't always available.David Majnemer2014-06-21
| | | | | | | | This Lexer test unconditionally used the i128 integer literal suffix. This suffix is only available to targets that have 128-bit arithmetic support. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211446 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++1z] Implement N3981: Disable trigraphs by default in C++1z mode.Richard Smith2014-06-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211392 91177308-0d34-0410-b5e6-96231b3b80d8
* Show -Wdate-time in system headersAlp Toker2014-06-10
| | | | | | | | | | Anyone enabling this warning would expect to hear about all occurrences including those in system headers that can cause non-reproducible builds. To achieve this, rework ShowInSystemHeader to remove broken unused mapping code that didn't make sense with a simpler and correct scheme. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210512 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement -Wdate-time preprocessor warningAlp Toker2014-06-10
| | | | | | | This GCC warning is useful for validating reproducible builds and might help when tracking down issues with modules too. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210511 91177308-0d34-0410-b5e6-96231b3b80d8
* Permit the "if" literal suffix with Microsoft extensions enabled.Peter Collingbourne2014-05-29
| | | | | | Differential Revision: http://reviews.llvm.org/D3963 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209859 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixing some comments in this test. No functional changes.Aaron Ballman2014-05-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209128 91177308-0d34-0410-b5e6-96231b3b80d8
* PR19698, PR19674: enable __has_feature checks for cxx_generic_lambdas andRichard Smith2014-05-09
| | | | | | | | cxx_decltype_auto, and fix documentation of cxx_generic_lambdas and cxx_init_captures to specify the right feature-check name. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208445 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up some existing keyword tests in the test/Lexer directory by using theYunzhong Gao2014-05-07
| | | | | | | | | | pre-defined __is_identifier() macro. Differential Revision: http://reviews.llvm.org/D3460 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208147 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some missing checks for C++1y digit separators that don't in fact separateRichard Smith2014-04-22
| | | | | | | | | digits. Turns out we have completely separate lexing codepaths for floating point numbers depending on whether or not they start with a zero. Who knew... =) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206932 91177308-0d34-0410-b5e6-96231b3b80d8
* Lex: Fix __has_feature(cxx_exceptions) for objective C++Justin Bogner2014-04-16
| | | | | | | | | | | | | | | At one point, -fexceptions was a synonym for -fcxx-exceptions. While the driver options still enables cxx-exceptions by default, the cc1 flag is purely about exception tables and this doesn't account for objective C exceptions. Because of this, checking for the cxx_exceptions feature in objective C++ often gives the wrong answer. The cxx_exceptions feature should be based on the -fcxx-exceptions cc1 flag, not -fexceptions. Furthermore, at some point the tests were changed to use cc1 even though they were testing the driver behaviour. We're better off testing both the driver and cc1 here. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206352 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a test to distinguish between reserved tokens and normal identifiers.Yunzhong Gao2014-04-11
| | | | | | | | | | | | | | The -fms-extensions option affects a number of subtle front-end C/C++ behaviors, and it would be useful to be able to distinguish MS keywords from regular identifiers in the ms-extensions mode even if the triple does not define a Windows target. It should make life easier if anyone needs to port their Windows codes to elsewhere. Differential Revision: http://reviews.llvm.org/D3034 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206069 91177308-0d34-0410-b5e6-96231b3b80d8
* Added a __has_feature() for 'is_constructible'Marshall Clow2014-03-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204153 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable cross-windows-on-linux.cpp for now. It may or may not fail. :/NAKAMURA Takumi2014-03-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203642 91177308-0d34-0410-b5e6-96231b3b80d8
* Lexer: split test into separate filesSaleem Abdulrasool2014-03-12
| | | | | | | | Unfortunately, XFAIL applies to the entire file. Split the test into two different units, enabling the proper application of XFAIL on the test which is expected to fail on Windows. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203633 91177308-0d34-0410-b5e6-96231b3b80d8
* Lex: reduce buffer size, add a testSaleem Abdulrasool2014-03-12
| | | | | | | Reduce the stack usage as hopefully include paths are usually not too long. Add a test case for the path normalisation behaviour. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203632 91177308-0d34-0410-b5e6-96231b3b80d8
* Tests for lexing of digit separators versus UCNs.Richard Smith2014-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202534 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a minor bug in lexing pp-numbers with digit separators: if a pp-number ↵Richard Smith2014-02-28
| | | | | | contains "'e+", the pp-number ends between the 'e' and the '+'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202533 91177308-0d34-0410-b5e6-96231b3b80d8
* Lexer: Issue -Wbackslash-newline-escape for line commentsAlp Toker2013-12-14
| | | | | | | | | | | | The warning for backslash and newline separated by whitespace was missed in this code path. backslash<whitespace><newline> is handled differently from compiler to compiler so it's important to warn consistently where there's ambiguity. Matches similar handling of block comments and non-comment lines. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197331 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Don't require -re suffix on -verify directives with regexes."Alp Toker2013-12-14
| | | | | | | | | | This patch was submitted to the list for review and didn't receive a LGTM. (In fact one explicit objection and one query were raised.) This reverts commit r197295. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197299 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't require -re suffix on -verify directives with regexes.Hans Wennborg2013-12-14
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2392 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197295 91177308-0d34-0410-b5e6-96231b3b80d8
* Change semantics of regex expectations in the diagnostic verifierHans Wennborg2013-12-11
| | | | | | | | | | | | | | | | | | | | | | | Previously, a line like // expected-error-re {{foo}} treats the entirety of foo as a regex. This is inconvenient when matching type names containing regex characters. For example, to match "void *(class test8::A::*)(void)" inside such a regex, one would have to type "void \*\(class test8::A::\*\)\(void\)". This patch changes the semantics of expected-error-re to only treat the parts of the directive wrapped in double curly braces as regexes. This avoids the escaping problem and leads to nicer patterns for those cases; see e.g. the change to test/Sema/format-strings-scanf.c. (The balanced search for closing }} of a directive also makes us handle the full directive in test\SemaCXX\constexpr-printing.cpp:41 and :53.) Differential Revision: http://llvm-reviews.chandlerc.com/D2388 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197092 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for C++'s SD6 feature test macros.Richard Smith2013-11-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195888 91177308-0d34-0410-b5e6-96231b3b80d8
* Relax header guard mismatch warning with edit distance heuristic.Ismail Pazarbasi2013-10-12
| | | | | | If the edit distance between the two macros is more than 50%, DefinedMacro may not be header guard or can be header guard of another header file or it might be defining something completely different set by the build environment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192547 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark lambda init-captures as complete.Richard Smith2013-09-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191607 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark variable template implementation as complete. Nearly all of the creditRichard Smith2013-09-27
| | | | | | | here goes to Larisse Voufo. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191549 91177308-0d34-0410-b5e6-96231b3b80d8
* Add macro test from N3781.Richard Smith2013-09-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191444 91177308-0d34-0410-b5e6-96231b3b80d8
* Per updates to D3781, allow underscore under ' in a pp-number, and allow ' ↵Richard Smith2013-09-26
| | | | | | in a #line directive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191443 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement C++1y digit separator proposal (' as a digit separator). This is notRichard Smith2013-09-26
| | | | | | | yet approved by full committee, but was unanimously supported by EWG. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191417 91177308-0d34-0410-b5e6-96231b3b80d8
* Lex and ignore Microsoft's #pragma warning(...)Reid Kleckner2013-09-13
| | | | | | | | | | | | | | | | | Summary: This fixes PR17145 and avoids unknown pragma warnings. This change does not attempt to map MSVC warning numbers to clang warning flags. Perhaps in the future we will implement a mapping for some common subset of Microsoft warnings, but for now we don't. Reviewers: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1652 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190726 91177308-0d34-0410-b5e6-96231b3b80d8
* Add specific warning flags for GNU ext in lexer.Eli Friedman2013-09-05
| | | | | | | | | | | | | This patch adds the following flags covering existing warnings: -Wgnu-zero-variadic-macro-arguments -Wgnu-imaginary-constant -Wgnu-binary-literal -Wgnu-zero-line-directive Patch by Peter Lewis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190017 91177308-0d34-0410-b5e6-96231b3b80d8
* Revise -Wnewline-eof test per feedback from Dmitri.Jordan Rose2013-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189113 91177308-0d34-0410-b5e6-96231b3b80d8
* Respect -Wnewline-eof even in C++11 mode.Jordan Rose2013-08-23
| | | | | | | | | | | If the user has requested this warning, we should emit it, even if it's not an extension in the current language mode. However, being an extension is more important, so prefer the pedantic warning or the pedantic-compatibility warning if those are enabled. <rdar://problem/12922063> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189110 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r188863 which could propose wrong fixits for multibyte character ↵Nick Lewycky2013-08-21
| | | | | | literals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188918 91177308-0d34-0410-b5e6-96231b3b80d8
* Issue fixits replacing invalid character literals with the equivalent \xNNNick Lewycky2013-08-21
| | | | | | | escape code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188863 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix FileCheck --check-prefix lines.Tim Northover2013-08-12
| | | | | | | | | | Various tests had sprung up over the years which had --check-prefix=ABC on the RUN line, but "CHECK-ABC:" later on. This happened to work before, but was strictly incorrect. FileCheck is getting stricter soon though. Patch by Ron Ofir. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188174 91177308-0d34-0410-b5e6-96231b3b80d8
* Partially revert r186903.Eli Friedman2013-07-26
| | | | | | | | It turns out that Plum Hall depends on us not emitting an error on integer literals which fit into long long, but fit into unsigned long long. So C99 conformance requires not conforming to C99. :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187172 91177308-0d34-0410-b5e6-96231b3b80d8
* Update documentation to match current C++1y feature set.Richard Smith2013-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187055 91177308-0d34-0410-b5e6-96231b3b80d8
* Integers which are too large should be an error.Eli Friedman2013-07-23
| | | | | | | | Switch some warnings over to errors which should never have been warnings in the first place. (Also, a minor fix to the preprocessor rules for integer literals while I'm here.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186903 91177308-0d34-0410-b5e6-96231b3b80d8
* Add 'not' to commands that are expected to fail.Rafael Espindola2013-07-04
| | | | | | | This is at least good documentation, but also opens the possibility of using pipefail. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185652 91177308-0d34-0410-b5e6-96231b3b80d8
* PR16339: Don't produce a diagnostic pointing at the whitespace between a '#if'Richard Smith2013-06-16
| | | | | | | | | and a '!defined(X)' if we find a broken header guard. This is suboptimal; we should point the diagnostic at the 'X' token not the 'if' token, but it fixes the crash. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184054 91177308-0d34-0410-b5e6-96231b3b80d8
* Introducing -Wheader-guard, a warning that checks header guards actually workRichard Trieu2013-06-12
| | | | | | | | | properly. This warning checks that the #ifndef and #define directives at the beginning of a header refer to the same macro name. Includes a fix-it hint to correct the header guard. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183867 91177308-0d34-0410-b5e6-96231b3b80d8
* Better diagnostics for string initialization.Hans Wennborg2013-05-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit improves Clang's diagnostics for string initialization. Where it would previously say: /tmp/a.c:3:9: error: array initializer must be an initializer list wchar_t s[] = "Hi"; ^ /tmp/a.c:4:6: error: array initializer must be an initializer list or string literal char t[] = L"Hi"; ^ It will now say /tmp/a.c:3:9: error: initializing wide char array with non-wide string literal wchar_t s[] = "Hi"; ^ /tmp/a.c:4:6: error: initializing char array with wide string literal char t[] = L"Hi"; ^ As a bonus, it also fixes the fact that Clang would previously reject this valid C11 code: char16_t s[] = u"hi"; char32_t t[] = U"hi"; because it would only recognize the built-in types for char16_t and char32_t, which do not exist in C. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181880 91177308-0d34-0410-b5e6-96231b3b80d8
* C++1y: provide full 'auto' return type deduction for lambda expressions. ThisRichard Smith2013-05-12
| | | | | | | completes the implementation of N3638. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181669 91177308-0d34-0410-b5e6-96231b3b80d8
* C++1y: Update __cplusplus to temporary value 201305L to allow detection of ↵Richard Smith2013-05-07
| | | | | | | | | | provisional C++1y support. Add __has_feature and __has_extension checks for C++1y features (based on the provisional names from the C++ features study group), and update documentation to match. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181342 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting r181004 since it has broken test/Sema/wchar.c.Aaron Ballman2013-05-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181122 91177308-0d34-0410-b5e6-96231b3b80d8
* Support __wchar_t in -fms-extensions and -fms-compatibility modes.Hans Wennborg2013-05-03
| | | | | | | | | | | | | | MSVC provides __wchar_t, either as an alias for the built-in wchar_t type, or as a separate type depending on language (C vs C++) and flags (-fno-wchar). In -fms-extensions, Clang will simply accept __wchar_t as an alias for whatever type is used for wide character literals. In -fms-compatibility, we try to mimic MSVC's behavior by always making __wchar_t a builtin type. This fixes PR15815. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181004 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a triple ensure that __has_feature(c_thread_local) is 1 in C11 mode.Douglas Gregor2013-05-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180925 91177308-0d34-0410-b5e6-96231b3b80d8
* Only evaluate __has_feature(c_thread_local) and ↵Douglas Gregor2013-05-02
| | | | | | __has_feature(cxx_thread_local) true when the target supports thread-local storage. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180909 91177308-0d34-0410-b5e6-96231b3b80d8
* Note that we support (and in fact have supported since the dawn of time itself)Richard Smith2013-04-19
| | | | | | | C++1y binary literals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179883 91177308-0d34-0410-b5e6-96231b3b80d8