So, looking through the IRGen failures that I am seeing on the Windows targets, it seems that the IRGen tests are going to need some serious finessing to make it correct for all the targets. On Windows, we use the singleton strategy to deal with the class initialisation due to the constant cross-module data initialisation not being possible. However, this manifests in some tests, that I think that we shouldn't just disable. However, the code generation patterns are sufficiently different (I'm taking a particular example here, but that isn't specifically the issue):
IRGen.typemetadata assumes that the type metadata accessor for an ObjC derived type will call
swift_getInitializedObjCClass which is not the case with the singleton pattern, and instead we will call
swift_getSingletonMetadata and extract the value from the returned type. This is then followed with an additional phi node to check if the cache was empty. Checking this requires a series of instructions to be checked.
I'm not sure what is the best way to handle this though (and most of the remaining tests are similarly complicated). Do we really want to start forking off versions of the tests?