summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Try to get cl-pch-showincludes passing on AArch64 bots.Nico Weber2016-03-131-0/+1
| | | | llvm-svn: 263400
* Remove compile time PreserveName in favor of a runtime cc1 ↵Mehdi Amini2016-03-138-19/+29
| | | | | | | | | | | | | | | | | | | | -discard-value-names option Summary: This flag is enabled by default in the driver when NDEBUG is set. It is forwarded on the LLVMContext to discard all value names (but GlobalValue) for performance purpose. This an improved version of D18024 Reviewers: echristo, chandlerc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18127 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 263394
* Added test that covers changes in r263379.Amjad Aboud2016-03-131-0/+10
| | | | llvm-svn: 263380
* Also test that the pch file is not printed in /showIncludesNico Weber2016-03-131-0/+1
| | | | llvm-svn: 263355
* Make test a bit stricter to check not just the file basename is printed.Nico Weber2016-03-131-4/+4
| | | | llvm-svn: 263353
* clang-cl: Add /Yc argument to /showIncludes output.Nico Weber2016-03-131-2/+1
| | | | | | | | | | To make this work, delay printing of ExtraDeps in HeaderIncludesCallback a bit, so that it happens after CompilerInstance::InitializeSourceManager() has run. General /FI arguments are still missing from /showIncludes output, this still needs to be fixed. llvm-svn: 263352
* clang-cl: Add a test for the interaction of /Yc and /showIncludes.Nico Weber2016-03-124-0/+23
| | | | | | | | We almost get this right, but not completely (see FIXME). It looks like /FI headers generally aren't included in /showIncludes yet, but they should be. But it seems good to have test coverage for the bits that already work. llvm-svn: 263344
* Add fix-it for format-security warnings.Bob Wilson2016-03-112-0/+37
| | | | llvm-svn: 263299
* Fix ObjCMethodDecl::findPropertyDecl for class properties.Jordan Rose2016-03-111-0/+25
| | | | | | | This affects code completion and a few other things; hopefully the code completion test is sufficient to catch regressions. llvm-svn: 263295
* Add missing triple to instantiate-sizeof.cpp testReid Kleckner2016-03-111-1/+1
| | | | llvm-svn: 263285
* Allow sizeof(UnrelatedClass::field) in C++11 class template methodsReid Kleckner2016-03-111-1/+26
| | | | | | | | | | | | | | | | | This feature works outside of templates by forming a DeclRefExpr to a FieldDecl instead of a MemberExpr, which requires a base object in addition to the FieldDecl. Previously, while building up the template AST before instantiation, we formed a CXXDependentScopeMemberExpr, which always instantiates to a MemberExpr. Now, in unevaluated contexts we form a DependentScopeDeclRefExpr, which is a more flexible node that can instantiate to either a MemberExpr or a DeclRefExpr depending on lookup results. Fixes PR26893. llvm-svn: 263279
* Update test case for llvm summary format changes in D17592.Teresa Johnson2016-03-111-4/+4
| | | | llvm-svn: 263276
* [SEH] Remove nounwind/noinline from outlined finally funcletsReid Kleckner2016-03-111-2/+19
| | | | | | With the new EH representation this is no longer necessary. llvm-svn: 263269
* Add tests for ARM Cortex-R8Alexandros Lamprineas2016-03-111-0/+3
| | | | | | | | | | | Add command-line tests for ARM Cortex-R8 checking that the driver calls clang -cc1 with the correct little-endian/big-endian, and ARM/Thumb triple. Patch by Pablo Barrio <pablo.barrio@arm.com> Differential Revision: http://reviews.llvm.org/D18052 llvm-svn: 263245
* Print strict in Availability attribute when it is on.Manman Ren2016-03-101-0/+3
| | | | llvm-svn: 263172
* Add has_feature objc_class_property.Manman Ren2016-03-101-0/+4
| | | | | | rdar://23891898 llvm-svn: 263171
* Reenable asm-errors.cNico Weber2016-03-101-3/+2
| | | | | | | r134811 made the test pass and reenabled it, but r134831 accidentally disabled it again due to a bad merge. llvm-svn: 263168
* Add test for r263138.Richard Smith2016-03-101-0/+13
| | | | llvm-svn: 263155
* Add TreatUnavailableAsInvalid for the verification-only mode in InitListChecker.Manman Ren2016-03-102-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given the following test case: typedef struct { const char *name; id field; } Test9; extern void doSomething(Test9 arg); void test9() { Test9 foo2 = {0, 0}; doSomething(foo2); } With a release compiler, we don't emit any message and silently ignore the variable "foo2". With an assert compiler, we get an assertion failure. The root cause ————————————— Back in r140457 we gave InitListChecker a verification-only mode, and will use CanUseDecl instead of DiagnoseUseOfDecl for verification-only mode. These two functions handle unavailable issues differently: In Sema::CanUseDecl, we say the decl is invalid when the Decl is unavailable and the current context is available. In Sema::DiagnoseUseOfDecl, we say the decl is usable by ignoring the return code of DiagnoseAvailabilityOfDecl So with an assert build, we will hit an assertion in diagnoseListInit assert(DiagnoseInitList.HadError() && "Inconsistent init list check result."); The fix ------------------- If we follow what is implemented in CanUseDecl and treat Decls with unavailable issues as invalid, the variable decl of “foo2” will be marked as invalid. Since unavailable checking is processed in delayed diagnostics (r197627), we will silently ignore the diagnostics when we find out that the variable decl is invalid. We add a flag "TreatUnavailableAsInvalid" for the verification-only mode. For overload resolution, we want to say decls with unavailable issues are invalid; but for everything else, we should say they are valid and emit diagnostics. Depending on the value of the flag, CanUseDecl can return different values for unavailable issues. rdar://23557300 Differential Revision: http://reviews.llvm.org/D15314 llvm-svn: 263149
* Updated SSE3 builtin tests to more closely match the llvm fast-isel ↵Simon Pilgrim2016-03-101-7/+9
| | | | | | equivalent tests llvm-svn: 263117
* Added note to SSE4a builtins about keeping in sync with llvm testsSimon Pilgrim2016-03-101-0/+2
| | | | llvm-svn: 263116
* Updated SSSE3 builtin tests to more closely match the llvm fast-isel ↵Simon Pilgrim2016-03-101-15/+17
| | | | | | equivalent tests llvm-svn: 263115
* ARM: fix arm_neon_intrinsics.c and re-enable.Tim Northover2016-03-101-6882/+6469
| | | | | | | It turns out I'd never actually tested my recent change because it was gated on long-tests. Failure ensued. llvm-svn: 263093
* Disable failing test and fix RUN line.Richard Trieu2016-03-101-2/+3
| | | | | | | | See https://llvm.org/bugs/show_bug.cgi?id=26894 for details. This change fixes the incorrect flags to Clang and the piping issue. It also disables the FileCheck portion of the test, which is currently failing. llvm-svn: 263091
* Fix false positives for for-loop-analysis warningSteven Wu2016-03-101-0/+15
| | | | | | | | | | | | | | | Summary: For PseudoObjectExpr, the DeclMatcher need to search only all the semantics but also need to search pass OpaqueValueExpr for all potential uses for the Decl. Reviewers: thakis, rtrieu, rjmccall, doug.gregor Subscribers: xazax.hun, rjmccall, doug.gregor, cfe-commits Differential Revision: http://reviews.llvm.org/D17627 llvm-svn: 263087
* ARM & AArch64: fix IR-converted tests.Tim Northover2016-03-098-2331/+2331
| | | | | | | My script was converting %a0 to [[A]]0 if it had seen %a defined before %a0. Oops. llvm-svn: 263056
* [PPC] FE support for generating VSX [negated] absolute value instructionsKit Barton2016-03-093-9/+33
| | | | | | | | | | Includes new built-in, conversion of built-in to target-independent intrinsic and update in the header file. Tests are also updated. There is a second part in the backend for which I will post a separate code-review. BACKEND PART SHOULD BE COMMITTED FIRST. Phabricator: http://reviews.llvm.org/D17816 llvm-svn: 263051
* ARM & AArch64: convert asm tests to LLVM IR and restrict optimizations.Tim Northover2016-03-0939-11755/+48443
| | | | | | | | | | | | | | | This is mostly a one-time autoconversion of tests that checked assembly after "-Owhatever" compiles to only run "opt -mem2reg" and check the assembly. This should make them much more stable to changes in LLVM so they won't break on unrelated changes. "opt -mem2reg" is a compromise designed to increase the readability of tests that check dataflow, while minimizing dependency on LLVM. Hopefully mem2reg is stable enough that no surpises will come along. Should address http://llvm.org/PR26815. llvm-svn: 263048
* AArch64: remove a couple more tests already covered elsewhere.Tim Northover2016-03-092-590/+0
| | | | llvm-svn: 263038
* Speculative fix for this test case (the test doesn't run on my typical build ↵Aaron Ballman2016-03-091-1/+1
| | | | | | environment). llvm-svn: 263034
* Implement support for [[maybe_unused]] in C++1z that is based off existing ↵Aaron Ballman2016-03-094-0/+56
| | | | | | support for unused, and treat it as an extension pre-C++1z. This also means extending the existing unused attribute so that it can be placed on an enum and enumerator, in addition to the other subjects. llvm-svn: 263025
* [OpenMP] Add support for multidimensional array sections in map clause SEMA.Samuel Antao2016-03-091-2/+122
| | | | | | | | | | | | Summary: In some cases it can be proved statically that multidimensional array section refer to contiguous storage and can therefore be allowed in a map clause. This patch adds support for those cases in SEMA. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: cfe-commits, fraggamuffin, caomhin Differential Revision: http://reviews.llvm.org/D17547 llvm-svn: 263019
* [GCC] PR23529 Sema part of attrbute abi_tag supportDmitry Polukhin2016-03-091-0/+43
| | | | | | | | | | | | | | | | | Original patch by Stefan Bühler http://reviews.llvm.org/D12834 Difference between original and this one: - fixed all comments in original code review - added more tests, all new diagnostics now covered by tests - moved abi_tag on re-declaration checks to Sema::mergeDeclAttributes where they actually may work as designed - clang-format + other stylistic changes Mangle part will be sent for review as a separate patch. Differential Revision: http://reviews.llvm.org/D17567 llvm-svn: 263015
* [OPENMP 4.5] Codegen for data members in 'linear' clauseAlexey Bataev2016-03-092-3/+231
| | | | | | | | OpenMP 4.5 allows privatization of non-static data members in OpenMP constructs. Patch adds proper codegen support for data members in 'linear' clause llvm-svn: 263003
* Accept absolute paths in the -fuse-ld option.Peter Zotov2016-03-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | This patch extends the -fuse-ld option to accept a full path to an executable and use it verbatim to invoke the linker. There are generally two reasons to desire this. The first reason relates to the sad truth is that Clang is retargetable, Binutils are not. While any Clang from a binary distribution is sufficient to compile code for a wide range of architectures and prefixed BFD linkers (e.g. installed as /usr/bin/arm-none-linux-gnueabi-ld) as well as cross-compiled libc's (for non-bare-metal targets) are widely available, including on all Debian derivatives, it is impossible to use them together because the -fuse-ld= option allows to specify neither a linker prefix nor a full path to one. The second reason is linker development, both when porting existing linkers to new architectures and when working on a new linker such as LLD. Differential Revision: http://reviews.llvm.org/D17952 llvm-svn: 262996
* [index] libclang: Make sure to treat forward ObjC protocols as ↵Argyrios Kyrtzidis2016-03-091-0/+5
| | | | | | | | ObjCProtocolRef declarations, and fix related crash. rdar://25035376 llvm-svn: 262985
* [index] Fix assertion hit when indexing re-declarations of built-in functions.Argyrios Kyrtzidis2016-03-091-0/+5
| | | | llvm-svn: 262984
* Readd testcase accidentally removed in r262888.Richard Smith2016-03-091-0/+2
| | | | llvm-svn: 262971
* Fix crash in access check for aggregate initialization of base classes. It'sRichard Smith2016-03-081-2/+66
| | | | | | | not obvious how to access-check these, so pick a conservative rule until we get feedback from CWG. llvm-svn: 262966
* AArch64: remove tests of intrinsics completely duplicated elsewhere.Tim Northover2016-03-0817-2507/+0
| | | | llvm-svn: 262964
* P0017R1: In C++1z, an aggregate class can have (public non-virtual) base ↵Richard Smith2016-03-084-81/+265
| | | | | | classes; these are initialized as if they were data members. llvm-svn: 262963
* Silence duplicate diagnostics because parsing of a standards-based attribute ↵Aaron Ballman2016-03-082-1/+8
| | | | | | triggers parsing diagnostics that may also be picked up during semantic analysis. llvm-svn: 262960
* Sema: Methods in unavailable classes are unavailableDuncan P. N. Exon Smith2016-03-081-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to the template cases in r262050, when a C++ method in an unavailable struct/class calls unavailable API, don't diagnose an error. I.e., this case was failing: void foo() __attribute__((unavailable)); struct __attribute__((unavailable)) A { void bar() { foo(); } }; Since A is unavailable, A::bar is allowed to call foo. However, we were emitting a diagnostic here. This commit checks up the context chain from A::bar, in a manner inspired by SemaDeclAttr.cpp:isDeclUnavailable. I expected to find other related issues but failed to trigger them: - I wondered if DeclBase::getAvailability should check for `TemplateDecl` instead of `FunctionTemplateDecl`, but I couldn't find a way to trigger this. I left behind a few extra tests to make sure we don't regress. - I wondered if Sema::isFunctionConsideredUnavailable should be symmetric, checking up the context chain of the callee (this commit only checks up the context chain of the caller). However, I couldn't think of a testcase that didn't require first referencing the unavailable type; this, we already diagnose. rdar://problem/25030656 llvm-svn: 262921
* Sema: Treat 'strict' availability flag like unavailableDuncan P. N. Exon Smith2016-03-081-0/+10
| | | | | | | | | | | | | | | | | | | | | | This is a follow-up to r261512, which made the 'strict' availability attribute flag behave like 'unavailable'. However, that fix was insufficient. The following case would (erroneously) error when the deployment target was older than 10.9: struct __attribute__((availability(macosx,strict,introduced=10.9))) A; __attribute__((availability(macosx,strict,introduced=10.9))) void f(A*); The use of A* in the argument list for f is valid here, since f and A have the same availability. The fix is to return AR_Unavailable from DeclBase::getAvailability instead of AR_NotYetIntroduced. This also reverts the special handling added in r261163, instead relying on the well-tested logic for AR_Unavailable. rdar://problem/23791325 llvm-svn: 262915
* [analyzer] Fix missed leak from MSVC specific allocation functionsAnna Zaks2016-03-081-0/+76
| | | | | | | | | | | | Add the wide character strdup variants (wcsdup, _wcsdup) and the MSVC version of alloca (_alloca) and other differently named function used by the Malloc checker. A patch by Alexander Riccio! Differential Revision: http://reviews.llvm.org/D17688 llvm-svn: 262894
* Move [[nodiscard]] tests into test/CXX tree.Richard Smith2016-03-082-5/+17
| | | | llvm-svn: 262888
* Define __has_cpp_attribute(fallthrough) to a more reasonable value. (What ↵Richard Smith2016-03-082-6/+17
| | | | | | year is it?!) llvm-svn: 262887
* Add accidentally forgotten testcase from r262881.Richard Smith2016-03-081-0/+70
| | | | llvm-svn: 262882
* P0188R1: add support for standard [[fallthrough]] attribute. This is almostRichard Smith2016-03-0810-24/+68
| | | | | | | | | | | | | | exactly the same as clang's existing [[clang::fallthrough]] attribute, which has been updated to have the same semantics. The one significant difference is that [[fallthrough]] is ill-formed if it's not used immediately before a switch label (even when -Wimplicit-fallthrough is disabled). To support that, we now build a CFG of any function that uses a '[[fallthrough]];' statement to check. In passing, fix some bugs with our support for statement attributes -- in particular, diagnose their use on declarations, rather than asserting. llvm-svn: 262881
* Implement support for [[nodiscard]] in C++1z that is based off existing ↵Aaron Ballman2016-03-073-6/+39
| | | | | | support for warn_unused_result, and treat it as an extension pre-C++1z. This also means extending the existing warn_unused_result attribute so that it can be placed on an enum as well as a class. llvm-svn: 262872
OpenPOWER on IntegriCloud