Files
swift-mirror/validation-test/Evolution/test_global_stored_to_computed.swift
Slava Pestov 6798eea160 Evolution: Some of these tests pass with swift_test_mode_optimize_none_with_implicit_dynamic
The remaining failures still warrant investigation.
2019-06-11 00:54:32 -07:00

26 lines
557 B
Swift

// RUN: %target-resilience-test
// REQUIRES: executable_test
import StdlibUnittest
import global_stored_to_computed
var GlobalStoredToComputed = TestSuite("GlobalStoredToComputed")
GlobalStoredToComputed.test("ChangeStoredToComputed") {
do {
@inline(never) func increment(_ x: inout Int) {
x += 1
}
expectEqual(globalStoredToComputed, 0)
increment(&globalStoredToComputed)
expectEqual(globalStoredToComputed, 1)
globalStoredToComputed = 0xbadf00d
expectEqual(globalStoredToComputed, 0xbadf00d)
}
}
runAllTests()