Currently, tests are scattered throughout multiple directories, making
it difficult to determine what is tested and what is not tested.
With upcoming work on interoperability between Swift and C++
(https://forums.swift.org/t/manifesto-interoperability-between-swift-and-c/33874),
we'd like to rearrange the tests and bring tests covering a single C/C++
feature next to each other.
This PR also adds tests for enabling C++ interop where possible.
This splits up the test into two halves in order to allow the test to
pass on Windows. Loosen the test to allow the enumeration to be
imported with signed and unsigned types as Windows uses signed
enumerations by default.
This enables additional tests for the ClangImporter. This found a
missing piece in the `-enable-objc-interop` work that was done
previously. Address that and enable the tests. There are now the
following failing tests on Linux:
* sdk - depends on Foundation (not hermetic, see SR-7572)
* mixed-nsuinteger - depends on Foundation (not hermetic, see SR-7572)
* import-mixed-with-header-twice - requires apple/swift PR#16022
* can_import_objc_idempotent - requires apple/swift PR#16022
* objc_protocol_renaming - requires apple/swift PR#16022
Normally we treat anonymous enums as defining constants, and since we
don't know how those constants are going to be used we import them as
Int when we know we can do so consistently across all platforms. But
this isn't the right thing to do if the anonymous enum is being used
as an ad-hoc type for a variable or field.
(This may /still/ not be the right thing to do---maybe we want to
import it with a made-up name like we do anonymous fields instead.
But at least this way any such variables or fields become usable,
when they previously crashed IRGen.)
https://bugs.swift.org/browse/SR-2511