blob: b3e672976cab6f55c69b6012b3826d3dd039dc2e [file] [log] [blame]
NAKAMURA Takumi9627bb62013-01-22 01:51:48 +00001// 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
Pirama Arumuga Nainar33337ca2015-05-06 11:48:57 -07003// CHECK: call i32 (...) @rhs()
Pirama Arumuga Nainar3ea9e332015-04-08 08:57:32 -07004// CHECK: [[V7:%.+]] = getelementptr inbounds %struct.__block_byref_i, %struct.__block_byref_i* [[Vi]], i32 0, i32 1
5// CHECK: load %struct.__block_byref_i*, %struct.__block_byref_i** [[V7]]
Pirama Arumuga Nainar33337ca2015-05-06 11:48:57 -07006// CHECK: call i32 (...) @rhs()
Pirama Arumuga Nainar3ea9e332015-04-08 08:57:32 -07007// CHECK: [[V11:%.+]] = getelementptr inbounds %struct.__block_byref_i, %struct.__block_byref_i* [[Vi]], i32 0, i32 1
8// CHECK: load %struct.__block_byref_i*, %struct.__block_byref_i** [[V11]]
Mike Stump99459b62009-05-21 21:05:15 +00009
10int rhs();
11
12void foo() {
13 __block int i;
14 i = rhs();
Mike Stumpcc0442f2009-05-22 19:07:20 +000015 i += rhs();
Mike Stump99459b62009-05-21 21:05:15 +000016}