teak-llvm/clang/test/CodeGenCXX/block-inalloca.cpp
Saleem Abdulrasool c1b46381db CodeGen: handle blocks correctly when inalloca'ed
When using blocks with C++ on Windows x86, it is possible to have the
block literal be pushed into the inalloca'ed parameters.  Teach IRGen to
handle the case properly by extracting the block literal from the
inalloca parameter.  This fixes the use of blocks with C++ on Windows
x86.

llvm-svn: 325724
2018-02-21 21:47:51 +00:00

12 lines
338 B
C++

// RUN: %clang_cc1 -triple i686-unknown-windows-msvc -fblocks -emit-llvm -o - %s | FileCheck %s
struct S {
S(const struct S &) {}
};
void (^b)(S) = ^(S) {};
// CHECK: [[DESCRIPTOR:%.*]] = getelementptr inbounds <{ i8*, %struct.S, [3 x i8] }>, <{ i8*, %struct.S, [3 x i8] }>* %0, i32 0, i32 0
// CHECK: load i8*, i8** [[DESCRIPTOR]]