aboutsummaryrefslogtreecommitdiff
path: root/test/PCH
AgeCommit message (Collapse)Author
2013-05-03Serialization for captured statementsBen Langmuir
Add serialization for captured statements and captured decls. Also add a const_capture_iterator to CapturedStmt. Test contributed by Wei Pan Differential Revision: http://llvm-reviews.chandlerc.com/D727 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181048 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26Implement C++1y decltype(auto).Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180610 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-20Add another test I forgot to svn add.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179959 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-17Extended VerifyDiagnosticConsumer to also verify source file for diagnostic.Andy Gibbs
VerifyDiagnosticConsumer previously would not check that the diagnostic and its matching directive referenced the same source file. Common practice was to create directives that referenced other files but only by line number, and this led to problems such as when the file containing the directive didn't have enough lines to match the location of the diagnostic in the other file, leading to bizarre file formatting and other oddities. This patch causes VerifyDiagnosticConsumer to match source files as well as line numbers. Therefore, a new syntax is made available for directives, for example: // expected-error@file:line {{diagnostic message}} This extends the @line feature where "file" is the file where the diagnostic is generated. The @line syntax is still available and uses the current file for the diagnostic. "file" can be specified either as a relative or absolute path - although the latter has less usefulness, I think! The #include search paths will be used to locate the file and if it is not found an error will be generated. The new check is not optional: if the directive is in a different file to the diagnostic, the file must be specified. Therefore, a number of test-cases have been updated with regard to this. This closes out PR15613. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179677 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-15Remove XFAIL now that the test is standalone.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179538 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-15[PCH/test] Make test/PCH/cxx-typeid.cpp self-contained by including the ↵Argyrios Kyrtzidis
relevant standard library declarations instead of depending on a system header inclusion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179537 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-15Add triples to these tests since they're now using TLS, which isn't ↵Richard Smith
available on all targets. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179514 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-13Annotate flavor of TLS variable (statically or dynamically initialized) onto ↵Richard Smith
the AST. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179447 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12Disable following tests for Hexagon:Jyotsna Verma
1) Driver/output-file-is-dir.c - Checks for object file which can't be created for Hexagon since assembler is unavailable. 2) PCH/cxx-typeid.cpp - 'typeinfo' include file is unavailable for Hexagon. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179385 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11[PCH] Change test/PCH/headersearch.cpp to use -emit-llvm-only instead of ↵Argyrios Kyrtzidis
-emit-obj git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179301 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-04Fix 41 of the 61 tests which fail with modules enabled: we were computing andRichard Smith
caching the linkage for a declaration before we set up its redeclaration chain, when determining whether a declaration could be a redeclaration of something from an unimported submodule. We actually want to look at the declaration as if it were not a redeclaration here, so compute the linkage but don't cache it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178733 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-01Don't eagerly deserialize every templated function (and every static dataRichard Smith
member inside a class template) when loading a PCH file or module. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178496 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18[PCH] Fix assertion hit related to enum decls inside templated funtions.Argyrios Kyrtzidis
Report and suggested fix by Tom Honermann! http://llvm.org/bugs/show_bug.cgi?id=13020 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177330 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08[PCH] When complaining that a header from the PCH was modified, also mentionArgyrios Kyrtzidis
the filename of the PCH file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176717 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28Add a test case, to make sure there is no crash on IRGen when using PCHArgyrios Kyrtzidis
Related to rdar://13114142 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176227 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-20Modify the tests to use attribute group references instead of listing theBill Wendling
function attributes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175606 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-16[PCH] Deserializing the DeclContext of a template parameter is not safeArgyrios Kyrtzidis
until recursive loading is finished. Otherwise we may end up with a template trying to deserialize a template parameter that is in the process of getting loaded. rdar://13135282 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175329 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-07Add OpenCL samplers as Clang builtin types and check sampler related ↵Guy Benyei
restrictions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174601 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05[frontend] Don't put a PCH/PTH filename into the set of includes in the ↵Argyrios Kyrtzidis
preprocessor options; since only one of them is allowed in command-line, process them separately. Otherwise, if more than one is specified in the command-line, one is processed normally and the others are going to be treated and included as header files. Related to radar://13140508 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174385 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26Preserve Sema::UndefinedInternals across PCH boundaries. FixesNick Lewycky
-Wundefined-internal warnings with PCH. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173538 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25clang/test/PCH/modified-header-error.c: Disable it again. It had been ↵NAKAMURA Takumi
problematic on win32 for while. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173439 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25clang/test: Drop "REQUIRES:shell" in three tests. They can run on win32.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173419 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23[PCH] Temporarily disable the "ambiguous macro" warning that is currently ↵Argyrios Kyrtzidis
bogus with a PCH that redefined a macro without undef'ing it first. Proper reconstruction of the macro info history from modules will properly fix this in subsequent commits. rdar://13016031 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173281 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22Switch to APFloat constructor taking fltSemantics.Tim Northover
This change also makes the serialisation store the required semantics, fixing an issue where PPC128 was always assumed when re-reading a 128-bit value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173139 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20Implement OpenCL event_t as Clang builtin type, including event_t related ↵Guy Benyei
OpenCL restrictions (OpenCL 1.2 spec 6.9) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172973 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18Revert Clang r172620 and r172629, which caused a hang when buildingDouglas Gregor
complicated modules (<rdar://problem/13038265>). Unfortunately, this un-fixes <rdar://problem/13016031>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172783 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16[PCH/Modules] Change how macro [re]definitions are de/serialized.Argyrios Kyrtzidis
Previously we would serialize the macro redefinitions as a list, part of the identifier, and try to chain them together across modules individually without having the info that they were already chained at definition time. Change this by serializing the macro redefinition chain and then try to synthesize the chain parts across modules. This allows us to correctly pinpoint when 2 different definitions are ambiguous because they came from unrelated modules. Fixes bogus "ambiguous expansion of macro" warning when a macro in a PCH is redefined without undef'ing it first. rdar://13016031 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172620 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-20Implement AST dumper for Decls.Alexander Kornienko
http://llvm-reviews.chandlerc.com/D52 Patch by Philip Craig! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170634 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-18Re-commit r170428 changes with Linux style file endings.Guy Benyei
Add OpenCL images as clang builtin types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170432 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-18Revert changes from r170428, as I accidentally changed the line endings of ↵Guy Benyei
these files to Windows style. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170431 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-18Add OpenCL images as clang builtin types.Guy Benyei
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170428 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-12clang/test: Suppress two tests on win32 for now, since, not sure, in r169829 ↵NAKAMURA Takumi
to r169831. "ansi-escape-sequences" is easy convenient to exclude win32. Please be patient. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169945 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11Try to fix Win32 failuresDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169923 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-08Finish implementing 'selected constructor' rules for triviality in C++11. InRichard Smith
the cases where we can't determine whether special members would be trivial while building the class, we eagerly declare those special members. The impact of this is bounded, since it does not trigger implicit declarations of special members in classes which merely *use* those classes. In order to determine whether we need to apply this rule, we also need to eagerly declare move operations and destructors in cases where they might be deleted. If a move operation were supposed to be deleted, it would instead be suppressed, and we could need overload resolution to determine if we fall back to a trivial copy operation. If a destructor were implicitly deleted, it would cause the move constructor of any derived classes to be suppressed. As discussed on cxx-abi-dev, C++11's selected constructor rules are also retroactively applied as a defect resolution in C++03 mode, in order to identify that class B has a non-trivial copy constructor (since it calls A's constructor template, not A's copy constructor): struct A { template<typename T> A(T &); }; struct B { mutable A a; }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169673 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-05Looks like lit on Windows can't cope with parens here, and in any case, we ↵Richard Smith
shouldn't need them after r169441. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169442 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-05More workarounds for PR10867.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169437 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-28Store on the CXXRecordDecl whether the class has, or would have, a copyRichard Smith
constructor/assignment operator with a const-qualified parameter type. The prior method for determining this incorrectly used overload resolution. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168775 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-15[PCH] Reading expressions from attributes should be done using ReadExpr(),Argyrios Kyrtzidis
not ReadExpr(). Also add a test case making sure the thread safety attributes work as expected when they come from a PCH. Fixes rdar://12584141 & http://llvm.org/PR13982 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168017 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-13Copy the decls returned by DeclContext::lookup_result to aArgyrios Kyrtzidis
new container so we can safely iterate over them. The container holding the lookup decls can under certain conditions be changed while iterating (e.g. because of deserialization). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167816 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-06[PCH] Write out the ClassTemplateDecl::Common::InjectedClassNameType typeArgyrios Kyrtzidis
reference instead of relying on computing it. In general, if storage is no issue, it is preferable to deserialize info from the PCH instead of trying to recompute it after the PCH was loaded. The incentive to change this now was due to r155303 changing how friend template classes in dependent contexts are handled; such classes can now be chained to a previous template class but the computed InjectedClassNameType may be different due to the extra template parameters from the dependent context. The new handling requires more investigation but, in the meantime, writing out InjectedClassNameType fixes PCH issue in rdar://12627738. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167425 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-05Our style for diagnostic messages is to not include a trailing dot.Matt Beaumont-Gay
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167379 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-31[PCH] Remove the stat cache from the PCH file.Argyrios Kyrtzidis
The stat cache became essentially useless ever since we started validating all file entries in the PCH. But the motivating reason for removing it now is that it also affected correctness in this situation: -You have a header without include guards (using "#pragma once" or #import) -When creating the PCH: -The same header is referenced in an #include with different filename cases. -In the PCH, of course, we record only one file entry for the header file -But we cache in the PCH file the stat info for both filename cases -Then the source files are updated and the header file is updated in a way that its size and modification time are the same but its inode changes -When using the PCH: -We validate the headers, we check that header file and we create a file entry with its current inode -There's another #include with a filename with different case than the previously created file entry -In order to get its stat info we go through the cached stat info of the PCH and we receive the old inode -because of the different inodes, we think they are different files so we go ahead and include its contents. Removing the stat cache will potentially break clients that are attempting to use the stat cache as a way of avoiding having the actual input files available. If that use case is important, patches are welcome to bring it back in a way that will actually work correctly (i.e., emit a PCH that is self-contained, coping with literal strings, line/column computations, etc.). This fixes rdar://5502805 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167172 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30[PCH] The diagnostic state points can refer to previously createdArgyrios Kyrtzidis
diagnostic states; make sure the ASTReader sets the diagnostic state properly instead of always recreating it. Fixes rdar://12581618 & http://llvm.org/PR14181 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166987 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-25Move the input files for test/PCH/badpch.c under test/PCH/Inputs/.Kaelyn Uhrain
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166711 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-25Correct test inovocations to use %clang_cc1 rather than direct invocation ↵David Tweed
(so that it can have additional options set when trying to debug issues causing regressions). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166681 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24Teach the PCH validator to check the preprocessor options, especiallyDouglas Gregor
the macros that are #define'd or #undef'd on the command line. This checking happens much earlier than the current macro-definition checking and is far cleaner, because it does a direct comparison rather than a diff of the predefines buffers. Moreover, it allows us to use the result of this check to skip over PCH files within a directory that have non-matching -D's or -U's on the command line. Finally, it improves the diagnostics a bit for mismatches, fixing <rdar://problem/8612222>. The old predefines-buffer diff'ing will go away in a subsequent commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166641 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24Explicitly specify C++98 when building the C++ precompiled header for this ↵Douglas Gregor
test, so that the test will work on Windows. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166601 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23clang/test/PCH/pch-dir.c: Update a comment for msvc. msvc(*-win32) implies ↵NAKAMURA Takumi
-std=c++11. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166478 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23clang/test/PCH/pch-dir.c: Mark it as XFAIL:msvc. It doesn't fail (virtually ↵NAKAMURA Takumi
xpass) on msvc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166473 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23clang/test/PCH/pch-dir.c: Relax expressions of path separators for Win32.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166471 91177308-0d34-0410-b5e6-96231b3b80d8