Files
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
bdwgc
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm-project
clang
clang-tools-extra
compiler-rt
cmake
docs
include
lib
test
BlocksRuntime
block-static.c
blockimport.c
byrefaccess.c
byrefcopy.c
byrefcopycopy.c
byrefcopyinner.c
byrefcopyint.c
byrefcopystack.c
byrefsanity.c
byrefstruct.c
c99.c
cast.c
constassign.c
copy-block-literal-rdar6439600.c
copyconstructor.C
copynull.c
dispatch_async.c
dispatch_call_Block_with_release.c
fail.c
flagsisa.c
globalexpression.c
goto.c
hasdescriptor.c
josh.C
k-and-r.c
large-struct.c
localisglobal.c
macro.c
makefile
modglobal.c
nestedimport.c
nullblockisa.c
objectRRGC.c
objectassign.c
orbars.c
rdar6396238.c
rdar6405500.c
rdar6414583.c
recursive-block.c
recursive-test.c
recursiveassign.c
reference.C
rettypepromotion.c
returnfunctionptr.c
shorthandexpression.c
sizeof.c
small-struct.c
structmember.c
testfilerunner.h
testfilerunner.m
varargs-bad-assign.c
varargs.c
variadic.c
voidarg.c
asan
builtins
cfi
dfsan
esan
fuzzer
hwasan
interception
lsan
msan
profile
safestack
sanitizer_common
scudo
tsan
ubsan
ubsan_minimal
xray
CMakeLists.txt
lit.common.cfg
lit.common.configured.in
unittests
www
.arcconfig
.gitignore
CMakeLists.txt
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
README.txt
libcxx
libcxxabi
libunwind
lld
lldb
llvm
openmp
polly
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
llvm
m4
man
mcs
mk
mono
msvc
netcore
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h

38 lines
788 B
C
Raw Normal View History

//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
/*
* copynull.c
* testObjects
*
* Created by Blaine Garst on 10/15/08.
*
*/
#import <stdio.h>
#import <Block.h>
#import <Block_private.h>
// CONFIG rdar://6295848
int main(int argc, char *argv[]) {
void (^block)(void) = (void (^)(void))0;
void (^blockcopy)(void) = Block_copy(block);
if (blockcopy != (void (^)(void))0) {
printf("whoops, somehow we copied NULL!\n");
return 1;
}
// make sure we can also
Block_release(blockcopy);
// and more secretly
//_Block_destroy(blockcopy);
printf("%s: success\n", argv[0]);
return 0;
}