aboutsummaryrefslogtreecommitdiff
path: root/test/Parser/block-pointer-decl.c
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-08-28 19:20:44 +0000
committerSteve Naroff <snaroff@apple.com>2008-08-28 19:20:44 +0000
commit296e8d5fdcf9946f51e866adc8d281379e51efe9 (patch)
treedaaa761eb0b9625ff204cc4c950692074f2a729f /test/Parser/block-pointer-decl.c
parent982e674e39b8022ff7dc020f9ed371f3904549c3 (diff)
Add parser/action support for block literal expressions.
Parser support for blocks is almost complete...just need to add support for the __block() storage class qualifier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55495 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/block-pointer-decl.c')
-rw-r--r--test/Parser/block-pointer-decl.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/Parser/block-pointer-decl.c b/test/Parser/block-pointer-decl.c
index eb7ebcb402..a9da3256a9 100644
--- a/test/Parser/block-pointer-decl.c
+++ b/test/Parser/block-pointer-decl.c
@@ -7,12 +7,20 @@ struct blockStruct {
int blockTaker (int (^myBlock)(int), int other_input)
{
- return 0;
+ return 5 * myBlock (other_input);
}
int main (int argc, char **argv)
{
- int (^blockptr) (int);
+ int (^blockptr) (int) = ^(int inval) {
+ printf ("Inputs: %d, %d.\n", argc, inval);
+ return argc * inval;
+ };
+
+
+ argc = 10;
+ printf ("I got: %d.\n",
+ blockTaker (blockptr, 6));
return 0;
}