llvm-project/clang/test
Akira Hatanaka d542ccfc97 [CodeGen][ObjC] Block captures should inherit the type of the captured
field in the enclosing lambda or block.

This patch fixes a bug in code-gen where it uses the type of the
declared variable rather than the type of the capture of the enclosing
lambda or block for the block capture. For example, in the following
function, code-gen currently uses i32* for the block capture "a" because
"a" is passed to foo1 as a reference, but it should use i32 since the
enclosing lambda captures "a" by value.

void foo1(int &a) {
  auto lambda = [a]{
    auto block1 = ^{
      i = a;
    };
    block1();
  };
  lambda();
}

rdar://problem/18586386

Differential Revision: https://reviews.llvm.org/D21104

llvm-svn: 281682
2016-09-16 00:02:06 +00:00
..
ARCMT [test/objcmt] Add a follow-up test case for r275600. 2016-07-15 20:40:24 +00:00
ASTMerge When importing classes and structs with anonymous structs, it is critical that 2016-07-14 19:53:44 +00:00
Analysis [analyzer] Fix ExprEngine::VisitMemberExpr 2016-09-13 19:17:20 +00:00
CXX Try contextually converting condition of constexpr if to Boolean value 2016-09-07 18:24:54 +00:00
CodeCompletion Implement filtering for code completion of identifiers. 2016-07-27 14:56:59 +00:00
CodeGen [Sema] Allow shifting a scalar operand by a vector operand. 2016-09-15 22:19:25 +00:00
CodeGenCUDA [CUDA] Raise an error if a wrong-side call is codegen'ed. 2016-08-15 23:00:49 +00:00
CodeGenCXX Update clang unittests for rL281586. 2016-09-15 06:31:30 +00:00
CodeGenObjC Update clang unittests for rL281586. 2016-09-15 06:31:30 +00:00
CodeGenObjCXX [CodeGen][ObjC] Block captures should inherit the type of the captured 2016-09-16 00:02:06 +00:00
CodeGenOpenCL AMDGPU: Fix target options fp32/64-denormals 2016-09-13 17:37:09 +00:00
Coverage
CoverageMapping [Coverage] Suppress creating a code region if the same area is covered by an expansion region. 2016-08-31 07:04:16 +00:00
Driver [CUDA] Don't try to run sanitizers on NVPTX. 2016-09-15 23:44:13 +00:00
FixIt ObjC Class Property: diagnostics when accessing a class property using instance. 2016-06-28 23:01:49 +00:00
Format Make clang-format remove duplicate headers when sorting #includes. 2016-08-10 09:32:23 +00:00
Frontend Reapply r281276 with passing -emit-llvm in one of the tests 2016-09-13 04:32:40 +00:00
Headers Add some MS aliases for existing intrinsics 2016-09-14 21:19:43 +00:00
Index [index] Fix crash with indexing designated init expressions inside templates. 2016-08-03 05:38:53 +00:00
Integration
Layout [MS ABI] Implement __declspec(empty_bases) and __declspec(layout_version) 2016-05-23 17:16:12 +00:00
Lexer Add -fmodules-ts flag to cc1 for the provisional C++ modules TS, and mark 2016-07-23 02:32:21 +00:00
Misc [tablegen] Check that an optional IdentifierArgument of an attribute is 2016-09-10 03:29:43 +00:00
Modules Revert "[modules] When merging one definition into another, propagate the list of re-exporting modules from the discarded definition to the retained definition." 2016-09-14 10:05:10 +00:00
OpenMP Revert "[OpenMP] Sema and parsing for 'teams distribute simd’ pragma" 2016-08-18 09:25:07 +00:00
PCH Do not validate pch when -fno-validate-pch is set 2016-09-07 18:40:20 +00:00
Parser C++ Modules TS: Add parsing and some semantic analysis support for 2016-09-08 23:14:54 +00:00
Preprocessor [CUDA] Make __GCC_ATOMIC_XXX_LOCK_FREE macros the same on host/device. 2016-09-09 20:35:43 +00:00
Profile [Profile] Enable profile merging with -fprofile-generat[=<dir>] 2016-07-22 22:25:01 +00:00
Rewriter
Sema [Sema] Allow shifting a scalar operand by a vector operand. 2016-09-15 22:19:25 +00:00
SemaCUDA [CUDA] Add test checking our ability to take a function pointer to a __global__ function on the host side. 2016-09-14 21:50:11 +00:00
SemaCXX Follow-up to r281367: Compare uuids case-insensitively. 2016-09-14 01:16:54 +00:00
SemaObjC [SemaObjC] Be more strict while parsing type arguments and protocols 2016-09-13 20:04:35 +00:00
SemaObjCXX Sema: support __declspec(dll*) on ObjC interfaces 2016-07-15 20:41:10 +00:00
SemaOpenCL [Sema] Relax overloading restrictions in C. 2016-09-02 22:59:57 +00:00
SemaTemplate [Sema] Don't diagnose an array type mismatch when the new or previous 2016-09-01 01:03:21 +00:00
TableGen
Tooling Back out the test case for r266973 for now. 2016-04-21 10:46:14 +00:00
Unit Replace hardcoded comment at 'lit.site.cfg.in' 2016-04-16 06:54:46 +00:00
VFS Don't diagnose non-modular includes when we are not compiling a module. 2016-08-26 17:16:46 +00:00
.clang-format
CMakeLists.txt Revert "[test] Add libLTO as a clang test dependency on Darwin" 2016-08-30 20:36:48 +00:00
TestRunner.sh
cxx-sections.data
lit.cfg C++ Modules TS: add frontend support for building pcm files from module 2016-08-26 00:14:38 +00:00
lit.site.cfg.in Replace hardcoded comment at 'lit.site.cfg.in' 2016-04-16 06:54:46 +00:00
make_test_dirs.pl