xref: /llvm-project/clang/test/CodeGen/blocks-seq.c (revision 94473f4db6a6f5f12d7c4081455b5b596094eac5)
1 // RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
2 // CHECK: [[Vi:%.+]] = alloca %struct.__block_byref_i, align 8
3 // CHECK: call i32 @rhs()
4 // CHECK: [[V7:%.+]] = getelementptr inbounds nuw %struct.__block_byref_i, ptr [[Vi]], i32 0, i32 1
5 // CHECK: load ptr, ptr [[V7]]
6 // CHECK: call i32 @rhs()
7 // CHECK: [[V11:%.+]] = getelementptr inbounds nuw %struct.__block_byref_i, ptr [[Vi]], i32 0, i32 1
8 // CHECK: load ptr, ptr [[V11]]
9 
10 int rhs(void);
11 
12 void foo(void) {
13   __block int i;
14   ^{ (void)i; };
15   i = rhs();
16   i += rhs();
17 }
18