summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Clean up 'target' attribute diagnosticsErich Keane2018-02-163-11/+23
| | | | | | | | | | | | | | There were a few issues previously with the target attribute diagnostics implementation that lead to the attribute being added to the AST despite having an error in it. This patch changes that, and adds a test to ensure it does not get added to the AST. Differential Revision: https://reviews.llvm.org/D43359 llvm-svn: 325364
* [ARM] Add tests for the vcvtr builtinsSjoerd Meijer2018-02-162-22/+53
| | | | | | | | | This adds Sema and Codegen tests for the vcvtr builtins (because they were missing). Differential Revision: https://reviews.llvm.org/D43372 llvm-svn: 325351
* [Coroutines] Use target-agnostic size_t in testBrian Gesiak2018-02-161-6/+6
| | | | | | | | | | | | | | | | Summary: Fix a test failure on ARM hosts that was caused by a difference in the type of size_t, by using a target-agnostic definiton. Test Plan: ``` clang -cc1 -internal-isystem build/lib/clang/7.0.0/include -nostdsysteminc \ -std=c++14 -fcoroutines-ts -verify clang/test/SemaCXX/coroutines.cpp \ -fcxx-exceptions -fexceptions \ -triple armeb-none-eabi ``` llvm-svn: 325342
* Revert r325321 "[Sema] Take into account the current context when checking the"Hans Wennborg2018-02-161-35/+0
| | | | | | | | | | | | | | This broke the Chromium build, see https://crbug.com/813017 > accessibility of a class member. > > This fixes PR32898. > > rdar://problem/33737747 > > Differential revision: https://reviews.llvm.org/D36918 llvm-svn: 325335
* [Sema] Take into account the current context when checking theAkira Hatanaka2018-02-161-0/+35
| | | | | | | | | | | | accessibility of a class member. This fixes PR32898. rdar://problem/33737747 Differential revision: https://reviews.llvm.org/D36918 llvm-svn: 325321
* [Coverage] Handle break/continue outside of loop bodiesVedant Kumar2018-02-161-0/+11
| | | | | | | | | Teach the coverage mapping logic to handle break or continue statements within for loop increments. Fixes llvm.org/PR36406. llvm-svn: 325319
* [Modules] Extend -fmodule-name semantic for frameworks with private modulesBruno Cardoso Lopes2018-02-161-0/+12
| | | | | | | | | | | | | Assume Foo.framework with two module maps and two modules Foo and Foo_Private. Framework authors need to skip building both Foo and Foo_Private when using -fmodule-name=Foo, since both are part of the framework and used interchangeably during compilation. rdar://problem/37500098 llvm-svn: 325305
* [OPENMP] Fix PR36399: Crash on C code with ordered doacross construct.Alexey Bataev2018-02-151-0/+61
| | | | | | | | | Codegen for ordered with doacross construct might produce incorrect code because of missing cleanup scope for the construct. Without this scope the final runtime function call could be emitted in the wrong order that leads to incorrect codegen. llvm-svn: 325304
* [OPENMP] Fix PR38398: compiler crash on standalone pragma ordered with ↵Alexey Bataev2018-02-151-0/+2
| | | | | | | | | depend sink|source clause. Patch fixes compiler crash on standalone #pragmas ordered with depend(sink|source) clauses. llvm-svn: 325302
* [Coroutines] Use allocator overload when availableBrian Gesiak2018-02-154-7/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Depends on https://reviews.llvm.org/D42605. An implementation of the behavior described in `[dcl.fct.def.coroutine]/7`: when a promise type overloads `operator new` using a "placement new" that takes the same argument types as the coroutine function, that overload is used when allocating the coroutine frame. Simply passing references to the coroutine function parameters directly to `operator new` results in invariant violations in LLVM's coroutine splitting pass, so this implementation modifies Clang codegen to produce allocator-specific alloc/store/loads for each parameter being forwarded to the allocator. Test Plan: `check-clang` Reviewers: rsmith, GorNishanov, eric_niebler Reviewed By: GorNishanov Subscribers: lewissbaker, EricWF, cfe-commits Differential Revision: https://reviews.llvm.org/D42606 llvm-svn: 325291
* [analyzer] Suppress temporary destructors for temporary arrays.Artem Dergachev2018-02-151-0/+16
| | | | | | | | | | | | | | | Array destructors, like constructors, need to be called for each element of the array separately. We do not have any mechanisms to do this in the analyzer, so for now all we do is evaluate a single constructor or destructor conservatively and give up. It automatically causes the necessary invalidation and pointer escape for the whole array, because this is how RegionStore works. Implement this conservative behavior for temporary destructors. This fixes the crash on the provided test. Differential Revision: https://reviews.llvm.org/D43149 llvm-svn: 325286
* [analyzer] Implement path notes for temporary destructors.Artem Dergachev2018-02-151-0/+64
| | | | | | | | | | | | | | Temporary destructors fire at the end of the full-expression. It is reasonable to attach the path note for entering/leaving the temporary destructor to its CXXBindTemporaryExpr. This would not affect lifetime-extended temporaries with their automatic destructors which aren't temporary destructors. The path note may be confusing in the case of destructors after elidable copy constructors. Differential Revision: https://reviews.llvm.org/D43144 llvm-svn: 325284
* [analyzer] Compute the correct this-region for temporary destructors.Artem Dergachev2018-02-153-1/+138
| | | | | | | | | | | | | | | | | | | Inline them if possible - a separate flag is added to control this. The whole thing is under the cfg-temporary-dtors flag, off by default so far. Temporary destructors are called at the end of full-expression. If the temporary is lifetime-extended, automatic destructors kick in instead, which are not addressed in this patch, and normally already work well modulo the overally broken support for lifetime extension. The patch operates by attaching the this-region to the CXXBindTemporaryExpr in the program state, and then recalling it during destruction that was triggered by that CXXBindTemporaryExpr. It has become possible because CXXBindTemporaryExpr is part of the construction context since r325210. Differential revision: https://reviews.llvm.org/D43104 llvm-svn: 325282
* Clean up AMDGCN testsYaxun Liu2018-02-1510-130/+130
| | | | | | Differential Revision: https://reviews.llvm.org/D43340 llvm-svn: 325279
* [Test] Remove mangled name from test.Matt Davis2018-02-151-1/+0
| | | | | | | This line is not needed in the test, and breaks Windows testing. Fixes the test added in r325175. llvm-svn: 325271
* [OpenCL] Fix __enqueue_block for block with capturesYaxun Liu2018-02-152-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | The following test case causes issue with codegen of __enqueue_block void (^block)(void) = ^{ callee(id, out); }; enqueue_kernel(queue, 0, ndrange, block); Clang first does codegen for block expression in the first line and deletes its block info. Clang then tries to do codegen for the same block expression again for the second line, and fails because the block info is gone. The fix is to do normal codegen for both lines. Introduce an API to OpenCL runtime to record llvm block invoke function and llvm block literal emitted for each AST block expression, and use the recorded information for generating the wrapper kernel. The EmitBlockLiteral APIs are cleaned up to minimize changes to the normal codegen of blocks. Another minor issue is that some clean up AST expression is generated for block with captures, which can be stripped by IgnoreImplicit. Differential Revision: https://reviews.llvm.org/D43240 llvm-svn: 325264
* Add -no-canonical-prefixes to allow different build modes.Martin Bohme2018-02-151-5/+5
| | | | llvm-svn: 325236
* [analyzer] Inline constructors for destroyable temporaries.Artem Dergachev2018-02-151-16/+105
| | | | | | | | | | | | | | | | | | | | | Since r325210, in cfg-temporary-dtors mode, we can rely on the CFG to tell us that we're indeed constructing a temporary, so we can trivially construct a temporary region and inline the constructor. Much like r325202, this is only done under the off-by-default cfg-temporary-dtors flag because the temporary destructor, even if available, will not be inlined and won't have the correct object value (target region). Unless this is fixed, it is quite unsafe to inline the constructor. If the temporary is lifetime-extended, the destructor would be an automatic destructor, which would be evaluated with a "correct" target region - modulo the series of incorrect relocations performed during the lifetime extension. It means that at least, values within the object are guaranteed to be properly escaped or invalidated. Differential Revision: https://reviews.llvm.org/D43062 llvm-svn: 325211
* [CFG] Provide construction contexts for temproary objects.Artem Dergachev2018-02-153-65/+264
| | | | | | | | | | | | | | | Constructors of C++ temporary objects that have destructors now can be queried to discover that they're indeed constructing temporary objects. The respective CXXBindTemporaryExpr, which is also repsonsible for destroying the temporary at the end of full-expression, is now available at the construction site in the CFG. This is all the context we need to provide for temporary objects that are not lifetime extended. For lifetime-extended temporaries, more context is necessary. Differential Revision: https://reviews.llvm.org/D43056 llvm-svn: 325210
* [analyzer] Decide on inlining destructors via EvalCallOptions.Artem Dergachev2018-02-151-1/+2
| | | | | | | | | | | | | | | | | | | | EvalCallOptions were introduced in r324018 for allowing various parts of ExprEngine to notify the inlining mechanism, while preparing for evaluating a function call, of possible difficulties with evaluating the call that they foresee. Then mayInlineCall() would still be a single place for making the decision. Use that mechanism for destructors as well - pass the necessary flags from the CFG-element-specific destructor handlers. Part of this patch accidentally leaked into r324018, which led into a change in tests; this change is reverted now, because even though the change looked correct, the underlying behavior wasn't. Both of these commits were not intended to introduce any function changes otherwise. Differential Revision: https://reviews.llvm.org/D42991 llvm-svn: 325209
* Reapply r325193Konstantin Zhuravlyov2018-02-151-0/+107
| | | | llvm-svn: 325203
* [analyzer] Allow inlining constructors into return values.Artem Dergachev2018-02-151-2/+162
| | | | | | | | | | | | | | | | | This only affects the cfg-temporary-dtors mode - in this mode we begin inlining constructors that are constructing function return values. These constructors have a correct construction context since r324952. Because temporary destructors are not only never inlined, but also don't have the correct target region yet, this change is not entirely safe. But this will be fixed in the subsequent commits, while this stays off behind the cfg-temporary-dtors flag. Lifetime extension for return values is still not modeled correctly. Differential Revision: https://reviews.llvm.org/D42875 llvm-svn: 325202
* Revert r325193 as it breaks buildbotsKonstantin Zhuravlyov2018-02-151-107/+0
| | | | llvm-svn: 325200
* AMDGPU: Enable PIC by default for amdgcnKonstantin Zhuravlyov2018-02-151-0/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D43094 llvm-svn: 325196
* AMDGPU: Cleanup most of the macrosKonstantin Zhuravlyov2018-02-151-0/+107
| | | | | | | | | | | - Insert __AMD__ macro - Insert __AMDGPU__ macro - Insert __devicename__ macro - Add missing tests for arch macros Differential Revision: https://reviews.llvm.org/D36802 llvm-svn: 325193
* Moved CHECK in test closer to source codeVitaly Buka2018-02-141-2/+3
| | | | llvm-svn: 325184
* [ThinLTO/CFI] Include TYPE_ID summaries into GLOBALVAL_SUMMARY_BLOCKVitaly Buka2018-02-144-0/+190
| | | | | | | | | | | | | | Summary: TypeID summaries are used by CFI and need to be serialized by ThinLTO indexing for later use by LTO Backend. Reviewers: tejohnson, pcc Subscribers: mehdi_amini, inglorion, eraman, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D42611 llvm-svn: 325182
* [Debug] Annotate compiler generated range-for loop variables.Matt Davis2018-02-143-6/+42
| | | | | | | | | | | | | | | | | | Summary: This change aims to simplify debugging by annotating the range-for loop artificial variables (range, begin, end) with the scope depth. Reviewers: rsmith, dblaikie Reviewed By: dblaikie Subscribers: dblaikie, cfe-commits Tags: #debug-info Differential Revision: https://reviews.llvm.org/D42813 llvm-svn: 325175
* [Modules] Add more language features to be used with requires-declarationBruno Cardoso Lopes2018-02-142-1/+34
| | | | | | | | | Features added: c99, c11, c17, cplusplus14 and cplusplus17. rdar://problem/36328787 rdar://problem/36668431 llvm-svn: 325154
* [OpenMP] Fix trailing space when printing pragmas, by Joel. E. DennyAlexey Bataev2018-02-1464-94/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: -ast-print prints omp pragmas with a trailing space. While this behavior is likely of little concern to most users, surely it's unintentional, and it's annoying for some source-level work I'm pursuing. This patch focuses on omp pragmas, but it also fixes init_seg and loop hint pragmas because they share implementation. The testing strategy here is to add usually just one '{{$}}' per relevant -ast-print test file. This seems to achieve good code coverage. However, this strategy is probably easy to forget as the tests evolve. That's probably fine as this fix is far from critical. The main goal of the testing is to aid the initial review. This patch also adds a fixme for "#pragma unroll", which prints as "#pragma unroll (enable)", which is invalid syntax. Reviewers: ABataev Reviewed By: ABataev Subscribers: guansong, cfe-commits Differential Revision: https://reviews.llvm.org/D43204 llvm-svn: 325145
* [CUDA] Allow external variables in separate compilationJonas Hahnfeld2018-02-141-0/+5
| | | | | | | | | | | | According to the CUDA Programming Guide this is prohibited in whole program compilation mode. This makes sense because external references cannot be satisfied in that mode anyway. However, such variables are allowed in separate compilation mode which is a valid use case. Differential Revision: https://reviews.llvm.org/D42923 llvm-svn: 325136
* Revert r324991 "Fix for PR32992. Static const classes not exported."Hans Wennborg2018-02-141-19/+0
| | | | | | | | | | | | This broke the Chromium build on Windows; see https://crbug.com/812231 > Fix for PR32992. Static const classes not exported. > > Patch by zahiraam! > > Differential Revision: https://reviews.llvm.org/D42968 llvm-svn: 325133
* [AST] Fix passing large-array-init.cpp on builds without assertsIvan A. Kosarev2018-02-141-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D43187 llvm-svn: 325123
* [AST] Refine the condition for element-dependent array fillersIvan A. Kosarev2018-02-141-0/+9
| | | | | | | | | | | | This patch fixes clang to not consider braced initializers for aggregate elements of arrays to be potentially dependent on the indices of the initialized elements. Resolves bug 18978: initialize a large static array = clang oom? https://bugs.llvm.org/show_bug.cgi?id=18978 Differential Revision: https://reviews.llvm.org/D43187 llvm-svn: 325120
* [Sema] Fix decltype of static data membersMikhail Maltsev2018-02-141-1/+6
| | | | | | | | | | | | | | | | | | | | | | | Summary: According to the C++11 standard [dcl.type.simple]p4: The type denoted by decltype(e) is defined as follows: - if e is an unparenthesized id-expression or an unparenthesized class member access (5.2.5), decltype(e) is the type of the entity named by e. Currently Clang handles the 'member access' case incorrectly for static data members (decltype returns T& instead of T). This patch fixes the issue. Reviewers: faisalv, rsmith, rogfer01 Reviewed By: rogfer01 Subscribers: rogfer01, cfe-commits Differential Revision: https://reviews.llvm.org/D42969 llvm-svn: 325117
* [ASTImporter] Fix lexical DC for templated decls; support ↵Aleksei Sidorin2018-02-142-0/+26
| | | | | | | | | | VarTemplatePartialSpecDecl Also minor refactoring in related functions was done. Differential Revision: https://reviews.llvm.org/D43012 llvm-svn: 325116
* Fix a couple of places where we assumed that non-type template parameters ↵Richard Smith2018-02-142-0/+14
| | | | | | are always rvalues. llvm-svn: 325095
* Implement function attribute artificialErich Keane2018-02-142-0/+14
| | | | | | | | | | | | Added support in clang for GCC function attribute 'artificial'. This attribute is used to control stepping behavior of debugger with respect to inline functions. Patch By: Elizabeth Andrews (eandrews) Differential Revision: https://reviews.llvm.org/D43259 llvm-svn: 325081
* Teach Wreturn-type, Wunreachable-code, and alpha.deadcode.UnreachableCode to ↵Nico Weber2018-02-133-0/+17
| | | | | | | | | treat __assume(0) like __builtin_unreachable. Fixes PR29134. https://reviews.llvm.org/D43221 llvm-svn: 325052
* Update StmtProfile.cpp to handle zero template arguments.Richard Trieu2018-02-131-0/+15
| | | | | | | Treat having no templates arguments differently than having zero template arguments when profiling. llvm-svn: 325040
* [AMDGPU] Change constant addr space to 4Yaxun Liu2018-02-1312-57/+67
| | | | | | Differential Revision: https://reviews.llvm.org/D43171 llvm-svn: 325031
* An updated test to show the current warnings produced for implicit ↵Andrew V. Tischenko2018-02-131-0/+14
| | | | | | conversions from 'double' to 'float'. llvm-svn: 325011
* Fix for PR32992. Static const classes not exported.Hans Wennborg2018-02-131-0/+19
| | | | | | | | Patch by zahiraam! Differential Revision: https://reviews.llvm.org/D42968 llvm-svn: 324991
* [DebugInfo] Avoid name conflict of generated VLA expression variable.Sander de Smalen2018-02-1310-11/+11
| | | | | | | | | | | | | | | | | Summary: This patch also adds the 'DW_AT_artificial' flag to the generated variable. Addresses the issues mentioned in http://llvm.org/PR30553. Reviewers: CarlosAlbertoEnciso, probinson, aprantl Reviewed By: aprantl Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D43189 llvm-svn: 324988
* [Modules] Fix remapping from Foo.Private to Foo_Private to happen before ↵Bruno Cardoso Lopes2018-02-121-0/+3
| | | | | | | | | | typo correction Typo correction is the last step here, remapping should come first. rdar://problem/37351970 llvm-svn: 324965
* [analyzer] Exploration strategy prioritizing unexplored coverage firstGeorge Karpenkov2018-02-121-0/+39
| | | | | | | | | | See reviews.llvm.org/M1 for evaluation, and lists.llvm.org/pipermail/cfe-dev/2018-January/056718.html for discussion. Differential Revision: https://reviews.llvm.org/D42775 llvm-svn: 324956
* [X86] Reverse the operand order of the implementation of the kunpack builtins.Craig Topper2018-02-122-3/+3
| | | | | | | | The second operand needs to be in the lower bits of the concatenation. This matches llvm 5.0, gcc, and icc behavior. Fixes PR36360. llvm-svn: 324954
* [CFG] Provide construction contexts for return value constructors.Artem Dergachev2018-02-122-2/+96
| | | | | | | | | | | When the current function returns a C++ object by value, CFG elements for constructors that construct the return values can now be queried to discover that they're indeed participating in construction of the respective return value at the respective return statement. Differential Revision: https://reviews.llvm.org/D42875 llvm-svn: 324952
* Look for 32-bit libraries in /usr/lib32 for MIPS O32 on FreeBSD.John Baldwin2018-02-121-0/+6
| | | | | | | | | | | | | | | Summary: FreeBSD N64 MIPS systems can include 32-bit libraries for O32 in /usr/lib32 similar to the 32-bit compatibility libraries provided for FreeBSD/amd64 and FreeBSD/powerpc64. Reviewers: dim Reviewed By: dim Differential Revision: https://reviews.llvm.org/D42972 llvm-svn: 324948
* [AArch64] Fixes for ARMv8.2-A FP16 scalar intrinsic - clang portionAbderrazek Zaafrani2018-02-121-31/+47
| | | | | | https://reviews.llvm.org/D42993 llvm-svn: 324940
OpenPOWER on IntegriCloud