- # check RR + GC/RR -> error
- ${FAIL_IF_SUCCESS} ${CC} foo.o bar-gc.o -dynamiclib -o libfoobar.dylib -framework Foundation 2> fail.log
+ # check RR + GC/RR -> RR
+ ${CC} ${CCFLAGS} foo.o bar-gc.o runtime.c -dynamiclib -o libfoobar.dylib
+ ${FAIL_IF_BAD_MACHO} libfoobar.dylib
+ otool -o libfoobar.dylib | grep -A4 _image | grep flags | grep 0x[26] | ${FAIL_IF_STDIN}
+
+ # check GC + GC/RR -> GC
+ ${CC} ${CCFLAGS} foo-gc-only.o bar-gc.o runtime.c -dynamiclib -o libfoobar.dylib
+ ${FAIL_IF_BAD_MACHO} libfoobar.dylib
+ otool -o libfoobar.dylib | grep -A4 _image | grep flags | grep 0x6 | ${FAIL_IF_EMPTY}