|
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
|
| 8 | +// REQUIRES: swift_feature_AddressableParameters |
7 | 9 |
|
8 | 10 | // Undefined hidden symbol to C++ voidify in libcxx
|
9 | 11 | // rdar://121551667
|
@@ -65,10 +67,18 @@ StdOptionalTestSuite.test("std::optional init(_:Wrapped)") {
|
65 | 67 |
|
66 | 68 | // FIXME: making these variables immutable triggers a miscompile on Linux
|
67 | 69 | // (https://github.com/swiftlang/swift/issues/82765)
|
68 |
| - var optBoolT = StdOptionalBool(true) |
69 |
| - var optBoolF = StdOptionalBool(false) |
| 70 | + var optBoolTMutable = StdOptionalBool(true) |
| 71 | + var optBoolFMutable = StdOptionalBool(false) |
| 72 | + expectTrue(optBoolTMutable.pointee) |
| 73 | + expectFalse(optBoolFMutable.pointee) |
| 74 | + |
| 75 | + // If AddressableParameters are enabled, this issue does not happen. |
| 76 | +#if hasFeature(AddressableParameters) |
| 77 | + let optBoolT = StdOptionalBool(true) |
| 78 | + let optBoolF = StdOptionalBool(false) |
70 | 79 | expectTrue(optBoolT.pointee)
|
71 | 80 | expectFalse(optBoolF.pointee)
|
| 81 | +#endif |
72 | 82 |
|
73 | 83 | let optString = StdOptionalString(std.string("abc"))
|
74 | 84 | expectEqual(std.string("abc"), optString.pointee)
|
|
0 commit comments