37 lines · c
1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5 6/*7 * copynull.c8 * testObjects9 *10 * Created by Blaine Garst on 10/15/08.11 *12 */13 14#import <stdio.h>15#import <Block.h>16#import <Block_private.h>17 18// CONFIG rdar://629584819 20int main(int argc, char *argv[]) {21 22 void (^block)(void) = (void (^)(void))0;23 void (^blockcopy)(void) = Block_copy(block);24 25 if (blockcopy != (void (^)(void))0) {26 printf("whoops, somehow we copied NULL!\n");27 return 1;28 }29 // make sure we can also30 Block_release(blockcopy);31 // and more secretly32 //_Block_destroy(blockcopy);33 34 printf("%s: success\n", argv[0]);35 return 0;36}37