Home | History | Annotate | Download | only in tests
      1 //
      2 //                     The LLVM Compiler Infrastructure
      3 //
      4 // This file is distributed under the University of Illinois Open Source
      5 // License. See LICENSE.TXT for details.
      6 
      7 // CONFIG rdar://6396238
      8 
      9 #include <stdio.h>
     10 #include <stdlib.h>
     11 
     12 static int count = 0;
     13 
     14 void (^mkblock(void))(void)
     15 {
     16     count++;
     17     return ^{
     18         count++;
     19     };
     20 }
     21 
     22 int main (int argc, const char * argv[]) {
     23     mkblock()();
     24     if (count != 2) {
     25         printf("%s: failure, 2 != %d\n", argv[0], count);
     26         exit(1);
     27     } else {
     28         printf("%s: success\n", argv[0]);
     29         exit(0);
     30     }
     31     return 0;
     32 }
     33