blob: 697a465a93173aa959214fb46297ce5d5346f919 [file] [log] [blame]
Fariborz Jahanian43aa1c32012-04-16 22:14:01 +00001// RUN: %clang_cc1 -E %s -o %t.mm
John McCall260611a2012-06-20 06:18:46 +00002// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %t.mm -o %t-rw.cpp
Fariborz Jahanian2663f522010-02-04 00:07:58 +00003// RUN: FileCheck -check-prefix LP --input-file=%t-rw.cpp %s
Fariborz Jahanian43aa1c32012-04-16 22:14:01 +00004// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %t.mm -o %t-modern-rw.cpp
5// RUN: FileCheck -check-prefix LP --input-file=%t-modern-rw.cpp %s
Fariborz Jahanian2663f522010-02-04 00:07:58 +00006// radar 7607781
7
8typedef struct {
9 int a;
10 int b;
11} mystruct;
12
13void g(int (^block)(mystruct s)) {
14 mystruct x;
15 int v = block(x);
16}
17
18void f(const void **arg) {
19 __block const void **q = arg;
20 g(^(mystruct s){
21 *q++ = (void*)s.a;
22 return 314;
23 });
24}
25
Fariborz Jahanian43aa1c32012-04-16 22:14:01 +000026// CHECK-LP: (__Block_byref_q_0 *)&q