minix/external/bsd/llvm/dist/clang/test/Rewriter/rewrite-captured-nested-bvar.c
Lionel Sambuc f4a2713ac8 Importing netbsd clang -- pristine
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
2014-07-28 17:05:57 +02:00

35 lines
839 B
C

// RUN: %clang_cc1 -x c -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
// RUN: FileCheck --input-file=%t-rw.cpp %s
// rdar://9006279
void q(void (^p)(void)) {
p();
}
void f() {
__block char BYREF_VAR_CHECK = 'a';
__block char d = 'd';
q(^{
q(^{
__block char e = 'e';
char l = 'l';
BYREF_VAR_CHECK = 'b';
d = 'd';
q(^{
e = '1';
BYREF_VAR_CHECK = '2';
d = '3';
}
);
});
});
}
int main() {
f();
return 0;
}
// CHECK 2: (__Block_byref_BYREF_VAR_CHECK_0 *)BYREF_VAR_CHECK
// CHECK: (__Block_byref_BYREF_VAR_CHECK_0 *)&BYREF_VAR_CHECK
// CHECK: (struct __Block_byref_BYREF_VAR_CHECK_0 *)&BYREF_VAR_CHECK, (struct __Block_byref_d_1 *)&d, 570425344));