summaryrefslogtreecommitdiffstats
path: root/llvm/test/FrontendC++/2009-06-30-ByrefBlock.cpp
diff options
context:
space:
mode:
authorStuart Hastings <stuart@apple.com>2009-07-01 15:40:10 +0000
committerStuart Hastings <stuart@apple.com>2009-07-01 15:40:10 +0000
commit67a2b76774dceb26251571af5a762b2354e086e9 (patch)
tree95d92b1cf980cde95ebf40030a0f607ca54407f1 /llvm/test/FrontendC++/2009-06-30-ByrefBlock.cpp
parentb8f779db877b64ee722cf621902d839b44da23b8 (diff)
downloadbcm5719-llvm-67a2b76774dceb26251571af5a762b2354e086e9.tar.gz
bcm5719-llvm-67a2b76774dceb26251571af5a762b2354e086e9.zip
Insure that __block_holder_tmp is allocated on the stack when a byref
variable is present. llvm-svn: 74610
Diffstat (limited to 'llvm/test/FrontendC++/2009-06-30-ByrefBlock.cpp')
-rw-r--r--llvm/test/FrontendC++/2009-06-30-ByrefBlock.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/test/FrontendC++/2009-06-30-ByrefBlock.cpp b/llvm/test/FrontendC++/2009-06-30-ByrefBlock.cpp
new file mode 100644
index 00000000000..6f8869c5413
--- /dev/null
+++ b/llvm/test/FrontendC++/2009-06-30-ByrefBlock.cpp
@@ -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;});
+}
OpenPOWER on IntegriCloud