Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / block-capture.cpp
blobc235d97bf5fbcb23b222ab4b995e76292725d449
1 // RUN: %clang_cc1 -x c++ -std=c++11 -fblocks -emit-llvm %s -o - | FileCheck %s
3 // CHECK: %struct.__block_byref_baz = type { ptr, ptr, i32, i32, i32 }
4 // CHECK: [[baz:%[0-9a-z_]*]] = alloca %struct.__block_byref_baz
5 // CHECK: [[bazref:%[0-9a-z_\.]*]] = getelementptr inbounds %struct.__block_byref_baz, ptr [[baz]], i32 0, i32 1
6 // CHECK: store ptr [[baz]], ptr [[bazref]]
7 // CHECK: call void @_Block_object_dispose(ptr [[baz]]
9 int main() {
10 __block int baz = [&]() { return 0; }();
11 ^{ (void)baz; };
12 return 0;