From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/Rewriter/blockcast3.mm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 clang/test/Rewriter/blockcast3.mm (limited to 'clang/test/Rewriter/blockcast3.mm') diff --git a/clang/test/Rewriter/blockcast3.mm b/clang/test/Rewriter/blockcast3.mm new file mode 100644 index 0000000..ceafcff --- /dev/null +++ b/clang/test/Rewriter/blockcast3.mm @@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -E %s -o %t.mm +// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc -fobjc-fragile-abi %t.mm -o %t-rw.cpp +// RUN: FileCheck -check-prefix LP --input-file=%t-rw.cpp %s +// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %t.mm -o %t-modern-rw.cpp +// RUN: FileCheck -check-prefix LP --input-file=%t-modern-rw.cpp %s +// radar 7607781 + +typedef struct { + int a; + int b; +} mystruct; + +void g(int (^block)(mystruct s)) { + mystruct x; + int v = block(x); +} + +void f(const void **arg) { + __block const void **q = arg; + g(^(mystruct s){ + *q++ = (void*)s.a; + return 314; + }); +} + +// CHECK-LP: (__Block_byref_q_0 *)&q -- cgit v1.2.3