The following code snippet crashes with clang-cl on Windows:
__attribute__((swiftcall)) void (*a)();
This is because we don't handle the swift calling convention on Windows in MicrosoftMangle.cpp.
This means that the Swift runtime can't currently be built on Windows, as the Swift runtime must be built with Clang (i.e. MSVC is not supported).
There are a couple of bugs tracking this:
http://bugs.llvm.org/show_bug.cgi?id=32000
https://bugs.swift.org/browse/SR-4302
I'm not sure the correct way to mangle the Swift calling convention. Itanium mangling uses "swiftcall", but I went with "S" in MicrosoftMangle, because it's a single character like the other calling convention mangling. Let me know if you have other suggestions for names, and I'd be happy to change this.