|
1 | 1 | // RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -cxx-interoperability-mode=swift-5.9)
|
2 | 2 | // RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -cxx-interoperability-mode=swift-6)
|
3 | 3 | // RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -cxx-interoperability-mode=upcoming-swift)
|
| 4 | +// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -cxx-interoperability-mode=upcoming-swift -enable-experimental-feature AddressableParameters) |
4 | 5 | // RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -cxx-interoperability-mode=upcoming-swift -Xcc -std=c++20)
|
5 | 6 | //
|
6 | 7 | // REQUIRES: executable_test
|
@@ -58,10 +59,18 @@ StdOptionalTestSuite.test("std::optional init(_:Wrapped)") {
|
58 | 59 |
|
59 | 60 | // FIXME: making these variables immutable triggers a miscompile on Linux
|
60 | 61 | // (https://github.com/swiftlang/swift/issues/82765)
|
61 |
| - var optBoolT = StdOptionalBool(true) |
62 |
| - var optBoolF = StdOptionalBool(false) |
| 62 | + var optBoolTMutable = StdOptionalBool(true) |
| 63 | + var optBoolFMutable = StdOptionalBool(false) |
| 64 | + expectTrue(optBoolTMutable.pointee) |
| 65 | + expectFalse(optBoolFMutable.pointee) |
| 66 | + |
| 67 | + // If AddressableParameters are enabled, this issue does not happen. |
| 68 | +#if hasFeature(AddressableParameters) |
| 69 | + let optBoolT = StdOptionalBool(true) |
| 70 | + let optBoolF = StdOptionalBool(false) |
63 | 71 | expectTrue(optBoolT.pointee)
|
64 | 72 | expectFalse(optBoolF.pointee)
|
| 73 | +#endif |
65 | 74 |
|
66 | 75 | let optString = StdOptionalString(std.string("abc"))
|
67 | 76 | expectEqual(std.string("abc"), optString.pointee)
|
|
0 commit comments