The deinit implementations used to access the ivar directly, but that can confuse the compiler into assuming the value never changes after its initialization, because it doesn’t see accesses that are done via the pointer.
Stop accessing the ivar directly once it has been initialized.
Now that we can rely on https://reviews.llvm.org/D86218, we don’t need to tiptoe around the use of `_Atomic(struct dword)`.
Rip out the clumsy encode/decode mess and the use of __uint128_t.
These are only ever called from opaque function bodies, so there is no need to make them inlinable anyway.
This allows us to stop linking client code with _AtomicsShims. (Although I don't quite understand how it was necessary before.)
- Disable building tests on Darwin
- Fix test registration on Linux when double-wide atomics aren't available
- Unconditionally enable double-wide atomics
This allows for testing without SPM on non-Darwin targets. We
explicitly exclude the manifest in SPM based builds because we would
like to use the automatic test discovery functionality from SPM.
SPM’s --generate-linuxmain feature doesn’t support conditionally compiled tests.
To run tests on non-Darwin platforms, use `swift test --enable-test-discovery`.
Linux on x86_64 unfortunately disables support for cmpxchg16 by default, making double-wide atomic operations fall back to using locks. We cannot currently override this on the package level, so stop providing double-wide atomics in this configuration by default.
To enable codegen support for double-wide atomics on Linux/x86_64, compile the package with `-Xcc -mcx16 -Xswiftc -DENABLE_DOUBLEWIDE_ATOMICS`.
This prevents an “unable to typecheck in reasonable time” error when compiling the test registry.
1612 tests under one test case is currently too many for swift-corelibs-xctest.
While we’re here, add explicit test cases for UnsafeRawPointer and Optional<UnsafeRawPointer>.