• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 /*
8  *  copynull.c
9  *  testObjects
10  *
11  *  Created by Blaine Garst on 10/15/08.
12  *
13  */
14 
15 #import <stdio.h>
16 #import <Block.h>
17 #import <Block_private.h>
18 
19 // CONFIG rdar://6295848
20 
main(int argc,char * argv[])21 int main(int argc, char *argv[]) {
22 
23     void (^block)(void) = (void (^)(void))0;
24     void (^blockcopy)(void) = Block_copy(block);
25 
26     if (blockcopy != (void (^)(void))0) {
27         printf("whoops, somehow we copied NULL!\n");
28         return 1;
29     }
30     // make sure we can also
31     Block_release(blockcopy);
32     // and more secretly
33     //_Block_destroy(blockcopy);
34 
35     printf("%s: success\n", argv[0]);
36     return 0;
37 }
38