// RUN: %target-run-simple-swift | %FileCheck %s // REQUIRES: executable_test import StdlibUnittest extension String { var bufferID: Int { guard let id = _guts._objectIdentifier else { return 0 } return id.hashValue } } // CHECK-NOT: Reallocations exceeded 30 func testReallocation() { var x = "The quick brown fox jumped over the lazy dog\n"._split(separator: " ") var story = "Let me tell you a story:" var laps = 1000 var reallocations = 0 for i in 0..= 30 { print("Reallocations exceeded 30") return } } } story += "." } print("total reallocations = \(reallocations)") } testReallocation() print("done!")