Insure that __block_holder_tmp is allocated on the stack when a byref
authorStuart Hastings <stuart@apple.com>
Wed, 1 Jul 2009 15:40:10 +0000 (15:40 +0000)
committerStuart Hastings <stuart@apple.com>
Wed, 1 Jul 2009 15:40:10 +0000 (15:40 +0000)
variable is present.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74610 91177308-0d34-0410-b5e6-96231b3b80d8

test/FrontendC++/2009-06-30-ByrefBlock.cpp [new file with mode: 0644]

diff --git a/test/FrontendC++/2009-06-30-ByrefBlock.cpp b/test/FrontendC++/2009-06-30-ByrefBlock.cpp
new file mode 100644 (file)
index 0000000..6f8869c
--- /dev/null
@@ -0,0 +1,8 @@
+// Insure __block_holder_tmp is allocated on the stack.
+// RUN: %llvmgxx %s -S -O2 -o - | egrep {__block_holder_tmp.*alloca}
+// <rdar://problem/5865221>
+extern void fubar_dispatch_sync(void (^PP)(void));
+void fubar() {
+  __block void *voodoo;
+ fubar_dispatch_sync(^(void){voodoo=0;});
+}