2022-10-07 14:09:44 +02:00
|
|
|
// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
|
2013-01-22 01:51:48 +00:00
|
|
|
// CHECK: [[Vi:%.+]] = alloca %struct.__block_byref_i, align 8
|
2022-02-15 09:27:12 -05:00
|
|
|
// CHECK: call i32 @rhs()
|
2024-08-09 13:25:04 +01:00
|
|
|
// CHECK: [[V7:%.+]] = getelementptr inbounds nuw %struct.__block_byref_i, ptr [[Vi]], i32 0, i32 1
|
2022-10-07 14:09:44 +02:00
|
|
|
// CHECK: load ptr, ptr [[V7]]
|
2022-02-15 09:27:12 -05:00
|
|
|
// CHECK: call i32 @rhs()
|
2024-08-09 13:25:04 +01:00
|
|
|
// CHECK: [[V11:%.+]] = getelementptr inbounds nuw %struct.__block_byref_i, ptr [[Vi]], i32 0, i32 1
|
2022-10-07 14:09:44 +02:00
|
|
|
// CHECK: load ptr, ptr [[V11]]
|
2009-05-21 21:05:15 +00:00
|
|
|
|
2022-02-15 09:27:12 -05:00
|
|
|
int rhs(void);
|
2009-05-21 21:05:15 +00:00
|
|
|
|
2022-02-15 09:27:12 -05:00
|
|
|
void foo(void) {
|
2009-05-21 21:05:15 +00:00
|
|
|
__block int i;
|
2018-10-01 21:51:28 +00:00
|
|
|
^{ (void)i; };
|
2009-05-21 21:05:15 +00:00
|
|
|
i = rhs();
|
2009-05-22 19:07:20 +00:00
|
|
|
i += rhs();
|
2009-05-21 21:05:15 +00:00
|
|
|
}
|