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