Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -208,13 +208,8 @@ ${PROG_NOINST}.3dsx: ${PROG_NOINST} 3dsxtool $< $@ CPPFLAGS += -I../src -I../src/exceptions -I../src/runtime -I.. -DSTDOUT OBJCFLAGS_RuntimeARCTests.m = -fobjc-arc -fobjc-arc-exceptions -# Clang on Windows creates an invalid call into -# objc_retainAutoreleasedReturnValue() in init with any optimization level -# greater 0. -# TODO: Investigate further and file a bug against Clang -OBJCFLAGS_RuntimeARCTests.m += -O0 LIBS := ${TESTS_LIBS} ${LIBS} LDFLAGS += ${MAP_LDFLAGS} LD = ${OBJC} Index: tests/RuntimeARCTests.m ================================================================== --- tests/RuntimeARCTests.m +++ tests/RuntimeARCTests.m @@ -25,11 +25,20 @@ @implementation RuntimeARCTest - (instancetype)init { self = [super init]; +#ifdef OF_WINDOWS + /* + * Clang has a bug on Windows where it creates an invalid call into + * objc_retainAutoreleasedReturnValue(). Work around it by not using an + * autoreleased exception. + */ + @throw [[OFException alloc] init]; +#else @throw [OFException exception]; +#endif return self; } @end