summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* C++ modules: if a class is defined in multiple modules (for instance, becauseRichard Smith2013-09-097-0/+33
| | | | | | | | | | | | it is an implicit instantiation of a class template specialization), pick the first-loaded definition to be the canonical definition, and merge all other definitions into it. This is still rather incomplete -- we need to extend every form of declaration that can appear within a CXXRecordDecl to be redeclarable if it came from an AST file (this includes fields, enumerators, ...). llvm-svn: 190315
* Sema: Don't crash on visibility attributes with an identifier argument.Benjamin Kramer2013-09-091-0/+2
| | | | | | PR17105. llvm-svn: 190312
* Removing the endian attribute and updating associated test cases. This ↵Aaron Ballman2013-09-092-16/+2
| | | | | | functionality was never completely implemented, and this is an improvement over silently eating the attribute. llvm-svn: 190303
* Commit 190296 missed out the tests; add them now. Note that it actually testsDavid Tweed2013-09-091-0/+19
| | | | | | | | "long long" which is currently technically only "reserved for future" use in OpenCL, but since clang in OpenCL mode supports it we may as well test the modifications to the settings made for that type. llvm-svn: 190297
* C++ modules: fix a bug where loading a declaration with some name would preventRichard Smith2013-09-095-5/+27
| | | | | | | | | | | | | | | | | name lookup from lazily deserializing the other declarations with the same name, by tracking a bit to indicate whether a name in a DeclContext might have additional external results. This also allows lazier reconciling of the lookup table if a module import adds decls to a pre-existing DC. However, this exposes a pre-existing bug, which causes a regression in test/Modules/decldef.mm: if we have a reference to a declaration, and a later-imported module adds a redeclaration, nothing causes us to load that redeclaration when we use or emit the reference (which can manifest as a reference to an undefined inline function, a use of an incomplete type, and so on). decldef.mm has been extended with an additional testcase which fails with or without this change. llvm-svn: 190293
* Implement aarch64 neon instruction set AdvSIMD (3V Diff), covering the ↵Jiangning Liu2013-09-091-0/+968
| | | | | | | | following 26 instructions, SADDL, UADDL, SADDW, UADDW, SSUBL, USUBL, SSUBW, USUBW, ADDHN, RADDHN, SABAL, UABAL, SUBHN, RSUBHN, SABDL, UABDL, SMLAL, UMLAL, SMLSL, UMLSL, SQDMLAL, SQDMLSL, SMULL, UMULL, SQDMULL, PMULL llvm-svn: 190289
* AST: __uuidof should leak through templated typesDavid Majnemer2013-09-071-0/+19
| | | | | | | | | | | | | | | Summary: __uuidof on templated types should exmaine if any of its template parameters have a uuid declspec. If exactly one does, then take it. Otherwise, issue an appropriate error. Reviewers: rsmith, thakis, rnk CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1419 llvm-svn: 190240
* ObjectiveC migrator: When inferring a property,Fariborz Jahanian2013-09-062-0/+14
| | | | | | | | preserve getter's attribute. Also, do not attach an inferred NS_RETURNS_INNER_POINTER to the inferred property (it is illegal). llvm-svn: 190223
* Add the missing "n" to libm LIBBUILTIN definitionsHal Finkel2013-09-061-9/+22
| | | | | | | | | | The libm math functions should be marked with the "n" (nothrow) flag so that the corresponding IR function declarations are tagged with the nounwind attribute (this has been true in C mode, but not in C++ mode). The test case has been updated to run in C++ mode in addition to in C mode. llvm-svn: 190217
* Preserve exception specs in function decl merging.Eli Friedman2013-09-061-0/+5
| | | | | | | | | Exception specs are not part of the canonical type, but we shouldn't drop them just because we merged a noreturn attribute. Fixes PR17110. llvm-svn: 190206
* clang-cl: ignore /RTC options (PR17129)Hans Wennborg2013-09-061-2/+2
| | | | | | | | I don't think Clang intends to implement this functionality. ASan should be used instead. Since /RTC is often passed by default from MSBuild, ignore the option to avoid bloating the output. llvm-svn: 190202
* Debug Info: Update testing case.Manman Ren2013-09-062-3/+3
| | | | | | | DIBuilder now uses an identifier to reference DIType in containing type field of a DICompositeType (in r190190). llvm-svn: 190191
* OpenMP: Data-sharing attributes analysis and clause 'shared' (fixed test ↵Alexey Bataev2013-09-065-13/+149
| | | | | | threadprivate_messages.cpp) llvm-svn: 190183
* Follow up on commit r190159. Also test the KFreeBSD i686 platform defines + ↵Sylvestre Ledru2013-09-061-1/+6
| | | | | | minor cosmetics llvm-svn: 190162
* Add a test for the KFreeBSD define (#define __FreeBSD_kernel__ 1). This was ↵Sylvestre Ledru2013-09-061-0/+4
| | | | | | introduced in commit r190048 llvm-svn: 190159
* OpenCL allows the (pre/post)-(increment/decrement) operator on integer ↵David Tweed2013-09-061-0/+19
| | | | | | | | | | vector types, so allow that case and add appropriate tests. Patch by Ruiling Song! llvm-svn: 190129
* Avoid double edges when constructing CFGsPavel Labath2013-09-061-0/+37
| | | | | | | | | | | | | | | | | | | | | Summary: If a noreturn destructor is executed while returning a value from a function, the resulting CFG has had two edges to the exit block. This crashed the analyzer, because it expects that blocks with no terminators have only one outgoing edge. I added code to avoid creating the second edge in this case. PS: The crashes did not manifest themselves always, as usually the NoReturnFunctionChecker would stop program evaluation before the analyzer hit the assertion, but in the case of lifetime extended temporaries, the checker failed to do that (which is a separate bug in itself). Reviewers: jordan_rose CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1513 llvm-svn: 190125
* PR17046, PR17092: Debug Info assert-on-valid due to member loss when context ↵David Blaikie2013-09-062-5/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | creation recreates the item the context is created for By removing the possibility of strange partial definitions with no members that older GCC's produced for the otherwise unreferenced outer types of referenced inner types, we can simplify debug info generation and correct this bug. Newer (4.8.1 and ToT) GCC's don't produce this quirky debug info, and instead produce the full definition for the outer type (except in the case where that type is dynamic and its vtable is not emitted in this TU). During the creation of the context for a type, we may revisit that type (due to the need to visit template parameters, among other things) and used to end up visiting it first there. Then when we would reach the original code attempting to define that type, we would lose debug info by overwriting its members. By avoiding the possibility of latent "defined with no members" types, we can be sure than whenever we already have a type in a cache (either a definition or declaration), we can just return that. In the case of a full definition, our work is done. In the case of a partial definition, we must already be in the process of completing it. And in the case of a declaration, the completed/vtable/etc callbacks can handle converting it to a definition. llvm-svn: 190122
* Add self-comparison warnings for fields.Eli Friedman2013-09-062-0/+35
| | | | | | | | | | | | This expands very slightly what -Wtautological-compare considers to be tautological to include implicit accesses to C++ fields and ObjC ivars. I don't want to turn this into a full expression-identity check, but these additions seem pretty well-contained, and maintain the theme of checking for "x == x". <rdar://problem/14431127> llvm-svn: 190118
* Consumed Analysis: The 'consumable' attribute now takes a identifier ↵David Blaikie2013-09-063-22/+23
| | | | | | | | | | | | | specifying the default assumed state for objects of this class This information is used for return states and pass-by-value parameter states. Patch by Chris Wailes. Review by DeLesley Hutchins and Aaron Ballman. llvm-svn: 190116
* When creating an implicit conversion sequence for a reference of type T from anRichard Smith2013-09-061-0/+7
| | | | | | | | initializer list containing a single element of type T, be sure to mark the sequence as a list conversion sequence so that it is known to be worse than an implicit conversion sequence that initializes a std::initializer_list object. llvm-svn: 190115
* C++11 attributes after 'constructor-name (' unambiguously signal that we have aRichard Smith2013-09-061-0/+5
| | | | | | constructor. llvm-svn: 190111
* Improve error for "override" + non-virtual func.Eli Friedman2013-09-051-0/+20
| | | | | | | | | | | | | | | | | | | Consider something like the following: struct X { virtual void foo(float x); }; struct Y : X { void foo(double x) override; }; The error is almost certainly that Y::foo() has the wrong signature, rather than incorrect usage of the override keyword. This patch adds an appropriate diagnostic for that case. Fixes <rdar://problem/14785106>. llvm-svn: 190109
* ObjectiveC migrator: tighten the rules for whenFariborz Jahanian2013-09-051-1/+1
| | | | | | | | | inferring NS_RETURNS_RETAINED, etc., return annotations. Do not infer if these annotations are implicit from the naming convention. Also add inference for NS_CONSUMES_SELF annotation. llvm-svn: 190106
* Debug Info: Update testing case.Manman Ren2013-09-051-11/+14
| | | | | | | DIBuilder now uses an identifier to reference DIType in base type field of ptr_to_member (in r190081). llvm-svn: 190082
* ObjectiveC modern translator: fix up generated fast enumerationFariborz Jahanian2013-09-051-0/+25
| | | | | | | code to work for bit 32bit and 64bit APIs. // rdar://14913632 llvm-svn: 190072
* clang-cl: Use .obj as extension for unnamed object files (PR17095)Hans Wennborg2013-09-051-0/+3
| | | | | | | | We already use .obj as extension when the user provides a stem file name (via /Fo), but were failing in the most basic case when the file name is based on the input file. llvm-svn: 190071
* Support suppressing unused arguments warnings as a core option so thatChandler Carruth2013-09-051-0/+4
| | | | | | it works in the CL flavor driver. llvm-svn: 190040
* [analyzer] Restructure a test filePavel Labath2013-09-051-708/+707
| | | | | | | | | | | | | | | | Summary: I've had a test failure here while experimenting and I've found that it's impossible to find what is wrong with the previous structure of the file. So I have grouped the expected output with the function that produces it, to make searching for discrepancies more obvious. Reviewers: jordan_rose CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1595 llvm-svn: 190037
* For "expected unqualified-id" errors after a double colon, and the double colonRichard Trieu2013-09-051-0/+15
| | | | | | | | is at the end of the line, point to the location after the double colon instead of at the next token. There is more context to be given this way. In addition, the next token can be several lines later. llvm-svn: 190029
* Add specific warning flags for GNU ext in lexer.Eli Friedman2013-09-051-0/+56
| | | | | | | | | | | | | 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. llvm-svn: 190017
* Note when a decl is used in AST files.Eli Friedman2013-09-053-1/+11
| | | | | | | | | | | | | | | When an AST file is built based on another AST file, it can use a decl from the fist file, and therefore mark the "isUsed" bit. We need to note this in the AST file so that the bit is set correctly when the second AST file is loaded. This patch introduces the distinction between setIsUsed() and markUsed() so that we don't call into the ASTMutationListener callback when it wouldn't be appropriate. Fixes PR16635. llvm-svn: 190016
* PR17103: Scoped enumerations with signed integer types have signed integerRichard Smith2013-09-041-1/+8
| | | | | | representation. Don't emit comparisons on them as 'icmp ult'! llvm-svn: 190010
* Tweak implementation of -Wwrite-strings to better match the behavior of ↵Richard Smith2013-09-041-1/+1
| | | | | | | | | | | | | | | | current GCCs: * In C, as before, if the "warning flag" is enabled, warnings are produced by forcing string literals to have const-qualified types (the produced warnings are *not* -Wwrite-strings warnings). However, more recent GCCs (at least 4.4 onwards) now take -w into account here, so we now do the same. * In C++, this flag is entirely sane: it behaves just like any other warning flag. Stop triggering -fconst-strings here. This is a bit cleaner, but there's no real functionality change except in the case where -Xclang -fno-const-strings is also specified. llvm-svn: 190006
* ObjectiveC migrator: start introducing NS_XXX annotationsFariborz Jahanian2013-09-041-20/+20
| | | | | | to Method/functions returning ObjC objects. wip. llvm-svn: 190005
* Do not emit duplicate global initializers for template static data members ↵David Blaikie2013-09-041-3/+28
| | | | | | | | | | | | | | | | | inside namespaces A quirk of AST representation leads to class template static data member definitions being visited twice during Clang IRGen resulting in duplicate (benign) initializers. Discovered while investigating a possibly-related debug info bug tickled by the duplicate emission of these members & their associated debug info. With thanks to Richard Smith for help investigating, understanding, and helping with the fix. llvm-svn: 189996
* ASTDumper: fix dump of CXXCatchStmtPavel Labath2013-09-041-1/+27
| | | | | | | | | | Summary: I added the display of the VarDecl contained in the statement. CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1596 llvm-svn: 189941
* clang/test/Driver/working-directory.c: Exclude msys bash rather than ↵NAKAMURA Takumi2013-09-041-0/+1
| | | | | | tweaking expressions. llvm-svn: 189927
* Inplement aarch64 neon instructions in AdvSIMD(shift). About 24 shift ↵Hao Liu2013-09-041-0/+1025
| | | | | | | | | | instructions: sshr,ushr,ssra,usra,srshr,urshr,srsra,ursra,sri,shl,sli,sqshlu,sqshl,uqshl,shrn,sqrshr$ and 4 convert instructions: scvtf,ucvtf,fcvtzs,fcvtzu llvm-svn: 189926
* Disable llvm optimizations, but keep -O1 to test available_externally.Rafael Espindola2013-09-041-1/+1
| | | | llvm-svn: 189919
* Disable llvm optimizations, but keep -O1 to test available_externally.Rafael Espindola2013-09-041-4/+4
| | | | llvm-svn: 189918
* Use %clang_cc1.Rafael Espindola2013-09-041-4/+4
| | | | llvm-svn: 189917
* Clear LookupResult object if invalid candidate is found.Serge Pavlov2013-09-041-0/+47
| | | | | | | If source code is invalid, error recovery can lead to name lookup in a set containing invalid declaration. The lookup is stopped once found such declaration, but LookupResult object could remain in inconsistent state. Its destructor triggered a check, which caused assert violation. This patch fixes PR16964 and PR12791. llvm-svn: 189916
* Don't pass -O0 to clang_cc1, it is the default.Rafael Espindola2013-09-0458-68/+68
| | | | llvm-svn: 189910
* Order initializers of static data members of explicit specializationsReid Kleckner2013-09-041-8/+43
| | | | | | | | I tried to implement this properly in r189051, but I didn't have enough test coverage. Richard kindly provided more test cases than I could possibly imagine and now we should have the correct condition. llvm-svn: 189898
* Add a diagnostic group for the "ignoring (static|inline) keyword onPeter Collingbourne2013-09-041-2/+1
| | | | | | explicit template instantiation" warning. llvm-svn: 189893
* ObjectiveC migrator: Cannot use bridging annotations forFariborz Jahanian2013-09-042-29/+5
| | | | | | | ObjectiveC methods. Apply specific annotations for them instead as determined by the static analyzer. llvm-svn: 189892
* Fix the test on -Asserts build.Rafael Espindola2013-09-031-8/+8
| | | | llvm-svn: 189888
* Use -O0 in this test too.Rafael Espindola2013-09-031-1/+1
| | | | llvm-svn: 189884
* clang-cl: Make -W a core option so we can adjust clang warnings.Reid Kleckner2013-09-031-0/+4
| | | | llvm-svn: 189882
OpenPOWER on IntegriCloud