diff options
Diffstat (limited to 'test/CodeGenCXX/instantiate-blocks.cpp')
-rw-r--r-- | test/CodeGenCXX/instantiate-blocks.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/CodeGenCXX/instantiate-blocks.cpp b/test/CodeGenCXX/instantiate-blocks.cpp index c8f897d..e206582 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); +} +} + + |