summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/instantiate-blocks.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-07-13 20:05:58 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-07-13 20:05:58 +0000
commite7ffbe233ed04f921a008ed893672ee759d1a0ad (patch)
tree3ee297421bcb2b1f6583e769cfbf3e2bf5608cd8 /test/CodeGenCXX/instantiate-blocks.cpp
parent90a8f27f144233b53cac0c88a1595f7f05105b7e (diff)
More block instantiation stuff. Set variable/param DeclContext
to block context when first instantiating them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108266 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/instantiate-blocks.cpp')
-rw-r--r--test/CodeGenCXX/instantiate-blocks.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/CodeGenCXX/instantiate-blocks.cpp b/test/CodeGenCXX/instantiate-blocks.cpp
index c8f897de82..e206582191 100644
--- a/test/CodeGenCXX/instantiate-blocks.cpp
+++ b/test/CodeGenCXX/instantiate-blocks.cpp
@@ -31,3 +31,29 @@ void test2(void)
{
foo(100, 'a');
}
+
+namespace rdar6182276 {
+extern "C" {
+int printf(const char *, ...);
+}
+
+template <typename T> T foo(T t)
+{
+ void (^testing)(int) = ^(int bar) { printf("bar is %d\n", bar); };
+ printf("bar is\n");
+ return 1;
+}
+
+template <typename T> void gorf(T t)
+{
+ foo(t);
+}
+
+
+void test(void)
+{
+ gorf(2);
+}
+}
+
+