Commits
Arnold Schwaighofer committed f003bc754d1
validation-test: Make this test pass in optimized mode
Some test cases where assuming to be compiled in Debug assert configuration.
The test relies on return autorelease optimization to happen. This does not
happen reliable in optimize mode.
I ran the test case under the leaks runner and no leaks are reported yet the
object count is positive. This can happen if some objects are still in a
autorelease pool at the time we count them. Which seems to happen.
I surrounded the code with "autoreleasepool {}" and it would pass which confirms
this assumption. I have looked at both the generated LLVM IR and the otool -tvV
asssembly output and did not see anything that would block the return
autorelease optimization (i.e instructions between the returnautorelease
function call and the retain_returnautorelease call) so I don't believe there is
something the compiler could do better.
rdar://21193916
Swift SVN r29369