From 82e5c0c592353dfcff77156b25e69ec3fcde852a Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 21 Dec 2015 17:22:39 -0800 Subject: [PATCH] Update various tests to stop using ++/-- --- test/1_stdlib/ArrayBridge.swift | 15 +++++----- test/1_stdlib/ArrayCore.swift | 7 +++-- test/1_stdlib/BridgeNonVerbatim.swift | 11 ++++---- test/1_stdlib/Builtins.swift | 4 +-- test/1_stdlib/Collection.swift | 5 ++-- test/1_stdlib/ErrorHandling.swift | 4 +-- test/1_stdlib/ErrorType.swift | 4 +-- test/1_stdlib/ErrorTypeBridging.swift | 4 +-- test/1_stdlib/Experimental.swift | 8 +++--- test/1_stdlib/Float.swift | 12 ++++---- test/1_stdlib/Generator.swift | 9 ++++-- test/1_stdlib/Lazy.swift.gyb | 28 +++++++++---------- test/1_stdlib/Map.swift | 4 ++- test/1_stdlib/NewArray.swift.gyb | 9 +++--- test/1_stdlib/Optional.swift | 2 +- test/1_stdlib/UnsafePointer.swift.gyb | 2 +- test/Constraints/lvalues.swift | 4 +-- test/DebugInfo/arg-debug_value.swift | 4 +-- test/DebugInfo/closure.swift | 2 +- test/DebugInfo/for.swift | 4 +-- test/DebugInfo/return.swift | 8 +++--- .../availability_weak_linking.swift | 6 ++-- test/Interpreter/break_continue.swift | 8 +++--- test/Interpreter/optional_lvalues.swift | 2 +- validation-test/stdlib/ArrayNew.swift.gyb | 2 +- 25 files changed, 89 insertions(+), 79 deletions(-) diff --git a/test/1_stdlib/ArrayBridge.swift b/test/1_stdlib/ArrayBridge.swift index 7a0255a6047ad..de91b38835eaa 100644 --- a/test/1_stdlib/ArrayBridge.swift +++ b/test/1_stdlib/ArrayBridge.swift @@ -47,14 +47,15 @@ class Tracked : NSObject, Fooable { func foo() { } required init(_ value: Int) { - ++trackedCount - serialNumber = ++nextTrackedSerialNumber + trackedCount += 1 + nextTrackedSerialNumber += 1 + serialNumber = nextTrackedSerialNumber self.value = value } deinit { assert(serialNumber > 0, "double destruction!") - --trackedCount + trackedCount -= 1 serialNumber = -serialNumber } @@ -102,7 +103,7 @@ struct BridgedSwift : CustomStringConvertible, _ObjectiveCBridgeable { } func _bridgeToObjectiveC() -> BridgedObjC { - ++bridgeToOperationCount + bridgeToOperationCount += 1 return BridgedObjC(trak.value) } @@ -115,7 +116,7 @@ struct BridgedSwift : CustomStringConvertible, _ObjectiveCBridgeable { inout result: BridgedSwift? ) { assert(x.value >= 0, "not bridged") - ++bridgeFromOperationCount + bridgeFromOperationCount += 1 result = BridgedSwift(x.value) } @@ -527,7 +528,7 @@ func testRoundTrip() { } } - var test = Test() + let test = Test() let array = [ BridgedSwift(10), BridgedSwift(20), BridgedSwift(30), @@ -555,7 +556,7 @@ print(x.objectAtIndex(0) as Base) */ func testMutableArray() { - var m = NSMutableArray(array: ["fu", "bar", "buzz"]) + let m = NSMutableArray(array: ["fu", "bar", "buzz"]) let a = m as NSArray as! [NSString] print(a) // CHECK-NEXT: [fu, bar, buzz] m.addObject("goop") diff --git a/test/1_stdlib/ArrayCore.swift b/test/1_stdlib/ArrayCore.swift index ae8759cce0cd8..707d49166b22c 100644 --- a/test/1_stdlib/ArrayCore.swift +++ b/test/1_stdlib/ArrayCore.swift @@ -23,14 +23,15 @@ var nextTrackedSerialNumber = 0 final class Tracked : ForwardIndexType, CustomStringConvertible { required init(_ value: Int) { - ++trackedCount - serialNumber = ++nextTrackedSerialNumber + trackedCount += 1 + nextTrackedSerialNumber += 1 + serialNumber = nextTrackedSerialNumber self.value = value } deinit { assert(serialNumber > 0, "double destruction!") - --trackedCount + trackedCount -= 1 serialNumber = -serialNumber } diff --git a/test/1_stdlib/BridgeNonVerbatim.swift b/test/1_stdlib/BridgeNonVerbatim.swift index 1f7129ce3fa47..b62cb55a57363 100644 --- a/test/1_stdlib/BridgeNonVerbatim.swift +++ b/test/1_stdlib/BridgeNonVerbatim.swift @@ -35,14 +35,15 @@ var nextTrackedSerialNumber = 0 final class Tracked : ForwardIndexType, CustomStringConvertible { required init(_ value: Int) { - ++trackedCount - serialNumber = ++nextTrackedSerialNumber + trackedCount += 1 + nextTrackedSerialNumber += 1 + serialNumber = nextTrackedSerialNumber self.value = value } deinit { assert(serialNumber > 0, "double destruction!") - --trackedCount + trackedCount -= 1 serialNumber = -serialNumber } @@ -111,12 +112,12 @@ func testScope() { // We can get a single element out // CHECK-NEXT: nsx[0]: 1 . - var one = nsx.objectAtIndex(0) as! Tracked + let one = nsx.objectAtIndex(0) as! Tracked print("nsx[0]: \(one.value) .") // We can get the element again, but it may not have the same identity // CHECK-NEXT: object identity matches? - var anotherOne = nsx.objectAtIndex(0) as! Tracked + let anotherOne = nsx.objectAtIndex(0) as! Tracked print("object identity matches? \(one === anotherOne)") // Because the elements come back at +0, we really don't want to diff --git a/test/1_stdlib/Builtins.swift b/test/1_stdlib/Builtins.swift index 8446814421732..acfeeaa3bfe2c 100644 --- a/test/1_stdlib/Builtins.swift +++ b/test/1_stdlib/Builtins.swift @@ -119,8 +119,8 @@ var NoisyDeathCount = 0 protocol P {} class Noisy : P { - init() { ++NoisyLifeCount } - deinit { ++NoisyDeathCount } + init() { NoisyLifeCount += 1 } + deinit { NoisyDeathCount += 1} } struct Large : P { diff --git a/test/1_stdlib/Collection.swift b/test/1_stdlib/Collection.swift index ef08005a6a540..93e6f149fcde1 100644 --- a/test/1_stdlib/Collection.swift +++ b/test/1_stdlib/Collection.swift @@ -45,7 +45,7 @@ func isPalindrome0< >(seq: S) -> Bool { typealias Index = S.Index - var a = seq.indices + let a = seq.indices var i = seq.indices var ir = i.lazy.reverse() var b = ir.generate() @@ -111,7 +111,8 @@ func isPalindrome2< var b = seq.startIndex, e = seq.endIndex while (b != e) { - if (b == --e) { + e = e.predecessor() + if (b == e) { break } if seq[b++] != seq[e] { diff --git a/test/1_stdlib/ErrorHandling.swift b/test/1_stdlib/ErrorHandling.swift index f92b5b41800ad..baf4acea82964 100644 --- a/test/1_stdlib/ErrorHandling.swift +++ b/test/1_stdlib/ErrorHandling.swift @@ -18,8 +18,8 @@ import ObjectiveC var NoisyCount = 0 class Noisy { - init() { NoisyCount++ } - deinit { NoisyCount-- } + init() { NoisyCount += 1 } + deinit { NoisyCount -= 1 } } enum SillyError: ErrorType { case JazzHands } diff --git a/test/1_stdlib/ErrorType.swift b/test/1_stdlib/ErrorType.swift index 043630b79f299..155f9ca43c52e 100644 --- a/test/1_stdlib/ErrorType.swift +++ b/test/1_stdlib/ErrorType.swift @@ -25,8 +25,8 @@ protocol OtherClassProtocol : class { } class NoisyError : ErrorType, OtherProtocol, OtherClassProtocol { - init() { ++NoisyErrorLifeCount } - deinit { ++NoisyErrorDeathCount } + init() { NoisyErrorLifeCount += 1 } + deinit { NoisyErrorDeathCount += 1 } let _domain = "NoisyError" let _code = 123 diff --git a/test/1_stdlib/ErrorTypeBridging.swift b/test/1_stdlib/ErrorTypeBridging.swift index 1355bfe993de0..99df736f1abae 100644 --- a/test/1_stdlib/ErrorTypeBridging.swift +++ b/test/1_stdlib/ErrorTypeBridging.swift @@ -22,8 +22,8 @@ protocol OtherClassProtocol : class { } class NoisyError : ErrorType, OtherProtocol, OtherClassProtocol { - init() { ++NoisyErrorLifeCount } - deinit { ++NoisyErrorDeathCount } + init() { NoisyErrorLifeCount += 1 } + deinit { NoisyErrorDeathCount += 1 } let _domain = "NoisyError" let _code = 123 diff --git a/test/1_stdlib/Experimental.swift b/test/1_stdlib/Experimental.swift index 5ffc6e0f04a45..9d717fe076172 100644 --- a/test/1_stdlib/Experimental.swift +++ b/test/1_stdlib/Experimental.swift @@ -46,8 +46,8 @@ ExperimentalTestSuite.test("ComposeOperator/CountCalls") { var aCalled = 0 var bCalled = 0 - func a(_: A) -> B { ++aCalled; return B() } - func b(_: B) -> C { ++bCalled; return C() } + func a(_: A) -> B { aCalled += 1; return B() } + func b(_: B) -> C { bCalled += 1; return C() } var result = b ∘ a expectEqual(0, aCalled) @@ -64,8 +64,8 @@ struct C {} var aCalled = 0 var bCalled = 0 -func a(_: A) -> B { ++aCalled; return B() } -func b(_: B) -> C { ++bCalled; return C() } +func a(_: A) -> B { aCalled += 1; return B() } +func b(_: B) -> C { bCalled += 1; return C() } ExperimentalTestSuite.test("ComposeOperator/CountCalls/Workaround") { var result = b ∘ a diff --git a/test/1_stdlib/Float.swift b/test/1_stdlib/Float.swift index 8cf37ecceb821..b96a700adc03b 100644 --- a/test/1_stdlib/Float.swift +++ b/test/1_stdlib/Float.swift @@ -37,12 +37,12 @@ func checkNormal(normal: TestFloat) { } func testNormal() { - var positiveNormal: TestFloat = 42.0 + let positiveNormal: TestFloat = 42.0 checkNormal(positiveNormal) _precondition(!positiveNormal.isSignMinus) _precondition(positiveNormal.floatingPointClass == .PositiveNormal) - var negativeNormal: TestFloat = -42.0 + let negativeNormal: TestFloat = -42.0 checkNormal(negativeNormal) _precondition(negativeNormal.isSignMinus) _precondition(negativeNormal.floatingPointClass == .NegativeNormal) @@ -74,12 +74,12 @@ func checkZero(zero: TestFloat) { } func testZero() { - var plusZero = noinlinePlusZero() + let plusZero = noinlinePlusZero() checkZero(plusZero) _precondition(!plusZero.isSignMinus) _precondition(plusZero.floatingPointClass == .PositiveZero) - var minusZero = noinlineMinusZero() + let minusZero = noinlineMinusZero() checkZero(minusZero) _precondition(minusZero.isSignMinus) _precondition(minusZero.floatingPointClass == .NegativeZero) @@ -129,7 +129,7 @@ func testSubnormal() { _preconditionFailure("unhandled float kind") } var positiveSubnormal: TestFloat = 1.0 - for var i = 0; i < iterations; i++ { + for var i = 0; i < iterations; i += 1 { positiveSubnormal /= 2.0 as TestFloat } checkSubnormal(positiveSubnormal) @@ -138,7 +138,7 @@ func testSubnormal() { _precondition(positiveSubnormal != 0.0) var negativeSubnormal: TestFloat = -1.0 - for var i = 0; i < iterations; i++ { + for var i = 0; i < iterations; i += 1{ negativeSubnormal /= 2.0 as TestFloat } checkSubnormal(negativeSubnormal) diff --git a/test/1_stdlib/Generator.swift b/test/1_stdlib/Generator.swift index 490ca315219f0..4533cdb19c0e7 100644 --- a/test/1_stdlib/Generator.swift +++ b/test/1_stdlib/Generator.swift @@ -35,7 +35,7 @@ tests.test("GeneratorSequence") { var x = MinimalGenerator(Array(r)) for a in GeneratorSequence(x) { expectEqual(r.startIndex, a) - ++r.startIndex + r.startIndex = r.startIndex.successor() } expectEqual(r.startIndex, r.endIndex) } @@ -43,7 +43,9 @@ tests.test("GeneratorSequence") { struct G : GeneratorType { var i = 0 mutating func next() -> Int? { - return i < 10 ? i++ : nil + if i >= 10 { return nil } + i += 1 + return i-1 } } @@ -51,7 +53,8 @@ extension G : SequenceType {} tests.test("GeneratorsModelSequenceTypeByDeclaration") { var n = 0 for i in G() { - expectEqual(n++, i) + expectEqual(n, i) + n += 1 } } diff --git a/test/1_stdlib/Lazy.swift.gyb b/test/1_stdlib/Lazy.swift.gyb index 6dcf90a87bcbe..ac00289606b54 100644 --- a/test/1_stdlib/Lazy.swift.gyb +++ b/test/1_stdlib/Lazy.swift.gyb @@ -209,7 +209,7 @@ struct SequenceWithCustomUnderestimateCount : SequenceType { } func underestimateCount() -> Int { - ++SequenceWithCustomUnderestimateCount.timesUnderestimateCountWasCalled + SequenceWithCustomUnderestimateCount.timesUnderestimateCountWasCalled += 1 return _data.underestimateCount() } @@ -487,7 +487,7 @@ tests.test("LazyMapSequence") { var calls = 0 var mapped = base.map { (x: OpaqueValue)->OpaqueValue in - ++calls + calls += 1 return OpaqueValue(Double(x.value) / 2.0) } @@ -529,7 +529,7 @@ tests.test("LazyMapCollection/${traversal}") { var calls = 0 var mapped = base.map { (x: OpaqueValue)->OpaqueValue in - ++calls + calls += 1 return OpaqueValue(Double(x.value) / 2.0) } expectEqual(0, calls) @@ -595,7 +595,7 @@ tests.test("ReverseCollection") { // Check that the reverse collection is still eager do { var calls = 0 - _ = r.reverse().map { _ in ++calls } + _ = r.reverse().map { _ in calls += 1 } expectEqual(r.count, calls) } @@ -606,7 +606,7 @@ tests.test("ReverseCollection") { // Check that the reverse collection is still eager do { var calls = 0 - _ = "foobar".characters.reverse().map { _ in ++calls } + _ = "foobar".characters.reverse().map { _ in calls += 1 } expectEqual("foobar".characters.count, calls) } } @@ -635,7 +635,7 @@ tests.test("ReverseCollection/Lazy") { ExpectType.test(reversed) var calls = 0 - let reversedAndMapped = reversed.map { (x)->Int in ++calls; return x } + let reversedAndMapped = reversed.map { (x)->Int in calls += 1; return x } expectEqual(0, calls) checkRandomAccessCollection(0...11, reversedAndMapped) expectNotEqual(0, calls) @@ -657,7 +657,7 @@ tests.test("ReverseCollection/Lazy") { ExpectType.test(reversed) var calls = 0 - let reversedAndMapped = reversed.map { (x)->Character in ++calls; return x } + let reversedAndMapped = reversed.map { (x)->Character in calls += 1; return x } expectEqual(0, calls) checkBidirectionalCollection("raboof".characters, reversedAndMapped) expectNotEqual(0, calls) @@ -695,7 +695,7 @@ tests.test("LazyFilterSequence") { var calls = 0 var filtered = MinimalSequence(elements: base).lazy.filter { - x in ++calls; + x in calls += 1; return x.value % 2 == 0 } expectEqual(calls, 0, "filtering was eager!") @@ -721,7 +721,7 @@ tests.test("LazyFilterSequence") { // Try again using explicit construction filtered = LazyFilterSequence( MinimalSequence(elements: base), - whereElementsSatisfy: { x in ++calls; return x.value % 2 == 0}) + whereElementsSatisfy: { x in calls += 1; return x.value % 2 == 0}) expectEqual(100, calls) @@ -759,7 +759,7 @@ tests.test("LazyFilterCollection") { var calls = 0 let filtered = base.lazy.filter { - x in ++calls; + x in calls += 1; return x.value % 2 == 0 } expectEqual(calls, 0, "filtering was eager!") @@ -821,7 +821,7 @@ do { elements: data.map { MinimalSequence(elements: $0) }) let flattened = base.flatten() var calls = 0 - _ = flattened.map { _ in ++calls } + _ = flattened.map { _ in calls += 1 } expectEqual( expected.count, calls, "unexpected laziness in \(flattened.dynamicType)") @@ -835,7 +835,7 @@ do { let flattened = base.flatten() var calls = 0 - _ = flattened.map { _ in ++calls } + _ = flattened.map { _ in calls += 1 } expectEqual(0, calls, "unexpected eagerness in \(flattened.dynamicType)") } @@ -850,7 +850,7 @@ do { // Checking that flatten doesn't introduce laziness var calls = 0 - _ = flattened.map { _ in ++calls } + _ = flattened.map { _ in calls += 1 } expectLE( expected.count, calls, "unexpected laziness in \(flattened.dynamicType)") @@ -865,7 +865,7 @@ do { let flattened = base.flatten() var calls = 0 - _ = flattened.map { _ in ++calls } + _ = flattened.map { _ in calls += 1 } expectEqual(0, calls, "unexpected eagerness in \(flattened.dynamicType)") } % end diff --git a/test/1_stdlib/Map.swift b/test/1_stdlib/Map.swift index 1a3e1bb4e6dd5..4587cff90e2f6 100644 --- a/test/1_stdlib/Map.swift +++ b/test/1_stdlib/Map.swift @@ -65,7 +65,9 @@ print(">") // A GeneratorType with reference semantics class Counter : GeneratorType { func next() -> Int? { - return n < end ? n++ : nil + if n >= end { return nil } + n += 1 + return n-1 } init(_ n: Int, _ end: Int) { diff --git a/test/1_stdlib/NewArray.swift.gyb b/test/1_stdlib/NewArray.swift.gyb index d12d3d5de08cc..a439db6bccb5f 100644 --- a/test/1_stdlib/NewArray.swift.gyb +++ b/test/1_stdlib/NewArray.swift.gyb @@ -30,14 +30,15 @@ final class X : ForwardIndexType, Comparable, CustomStringConvertible, IntegerLiteralConvertible { required init(_ value: Int) { - ++xCount - serial = ++xSerial + xCount += 1 + xSerial += 1 + serial = xSerial self.value = value } deinit { assert(serial > 0, "double destruction!") - --xCount + xCount -= 1 serial = -serial } @@ -155,7 +156,7 @@ where T.Generator.Element == T._Buffer.Element, let oldId = bufferID(a) growBy1(&a) if oldId != bufferID(a) { - ++reallocations + reallocations += 1 } } diff --git a/test/1_stdlib/Optional.swift b/test/1_stdlib/Optional.swift index 34c69560a2f6f..e7e07bf8bc653 100644 --- a/test/1_stdlib/Optional.swift +++ b/test/1_stdlib/Optional.swift @@ -140,7 +140,7 @@ OptionalTests.test("nil comparison") { OptionalTests.test("??") { var counter = 0 - func nextCounter() -> Int { return counter++ } + func nextCounter() -> Int { counter += 1; return counter-1 } func nextCounter2() -> Int? { return nextCounter() } let a: Int? = 123 diff --git a/test/1_stdlib/UnsafePointer.swift.gyb b/test/1_stdlib/UnsafePointer.swift.gyb index 8d685d1ea113a..63afc948b52b0 100644 --- a/test/1_stdlib/UnsafePointer.swift.gyb +++ b/test/1_stdlib/UnsafePointer.swift.gyb @@ -132,7 +132,7 @@ class Missile { static var missilesLaunched = 0 let number: Int init(_ number: Int) { self.number = number } - deinit { Missile.missilesLaunched++ } + deinit { Missile.missilesLaunched += 1 } } func checkPointerCorrectness(check: Check, diff --git a/test/Constraints/lvalues.swift b/test/Constraints/lvalues.swift index 2e64cfd6eef2c..b586296b459a8 100644 --- a/test/Constraints/lvalues.swift +++ b/test/Constraints/lvalues.swift @@ -106,7 +106,7 @@ fref().property = 0.0 f2(&fref().property) f1(&fref().property) fref().property += 0.0 -++fref().property +fref().property += 1 // settable property of a non-settable value type is non-settable: z.non_settable_x.property = 1.0 // expected-error{{cannot assign to property: 'non_settable_x' is a get-only property}} @@ -120,7 +120,7 @@ z.non_settable_reftype.property = 1.0 f2(&z.non_settable_reftype.property) f1(&z.non_settable_reftype.property) z.non_settable_reftype.property += 1.0 -++z.non_settable_reftype.property +z.non_settable_reftype.property += 1 // regressions with non-settable subscripts in value contexts _ = z[0] == 0 diff --git a/test/DebugInfo/arg-debug_value.swift b/test/DebugInfo/arg-debug_value.swift index b93de74330360..989cd6c138669 100644 --- a/test/DebugInfo/arg-debug_value.swift +++ b/test/DebugInfo/arg-debug_value.swift @@ -5,11 +5,11 @@ var g: Int64 = 1 class Foo { - var x: Int64 + var x: Int64 // CHECK: define {{.*}}_TFC4main3FoocfT_S0_ // CHECK: entry: // CHECK-NEXT: %[[SELF:.*]] = alloca // CHECK-NEXT: store %C4main3Foo* %0, %C4main3Foo** %[[SELF]] // CHECK-NEXT: call void @llvm.dbg.declare({{.*}}%[[SELF]] - init () { x = g++ } + init () { x = g; g += 1 } } diff --git a/test/DebugInfo/closure.swift b/test/DebugInfo/closure.swift index e175948b8fb19..73380d0da2574 100644 --- a/test/DebugInfo/closure.swift +++ b/test/DebugInfo/closure.swift @@ -5,7 +5,7 @@ func markUsed(t: T) {} func foldl1(list: [T], _ function: (a: T, b: T) -> T) -> T { assert(list.count > 1) var accumulator = list[0] - for var i = 1; i < list.count; ++i { + for var i = 1; i < list.count; i += 1 { accumulator = function(a: accumulator, b: list[i]) } return accumulator diff --git a/test/DebugInfo/for.swift b/test/DebugInfo/for.swift index 69926ebdfcc04..5a2bf3709831b 100644 --- a/test/DebugInfo/for.swift +++ b/test/DebugInfo/for.swift @@ -2,11 +2,11 @@ // Verify that variables bound in the for statements are in distinct scopes. -for var i = 0; i < 3; ++i { +for var i = 0; i < 3; i += 1 { // CHECK: !DILocalVariable(name: "i", scope: ![[SCOPE1:[0-9]+]] // CHECK: ![[SCOPE1]] = distinct !DILexicalBlock(scope: ![[MAIN:[0-9]+]] } -for var i = 0; i < 3; ++i { +for var i = 0; i < 3; i += 1 { // CHECK: !DILocalVariable(name: "i", scope: ![[SCOPE2:[0-9]+]] // CHECK: ![[SCOPE2]] = distinct !DILexicalBlock(scope: ![[MAIN]] } diff --git a/test/DebugInfo/return.swift b/test/DebugInfo/return.swift index d59aecbeb6bf7..1554959dd5898 100644 --- a/test/DebugInfo/return.swift +++ b/test/DebugInfo/return.swift @@ -7,15 +7,15 @@ class X { // CHECK: define {{.*}}ifelseexpr public func ifelseexpr() -> Int64 { - var x = X(i:0); + var x = X(i:0) // CHECK: [[META:%.*]] = call %swift.type* @_TMaC6return1X() // CHECK: [[X:%.*]] = call %C6return1X* @_TFC6return1XCfT1iVs5Int64_S0_( // CHECK-SAME: i64 0, %swift.type* [[META]]) // CHECK: @swift_release to void (%C6return1X*)*)(%C6return1X* [[X]]) if true { - x.x++; + x.x += 1 } else { - x.x--; + x.x -= 1 } // CHECK: @swift_release to void (%C6return1X*)*)(%C6return1X* [[X]]) // CHECK: @swift_release to void (%C6return1X*)*)(%C6return1X* [[X]]) @@ -23,6 +23,6 @@ public func ifelseexpr() -> Int64 { // The ret instruction should be in the same scope as the return expression. // CHECK: ret{{.*}}, !dbg ![[RELEASE]] - return x.x; // CHECK: ![[RELEASE]] = !DILocation(line: [[@LINE]], column: 3 + return x.x // CHECK: ![[RELEASE]] = !DILocation(line: [[@LINE]], column: 3 } diff --git a/test/Interpreter/availability_weak_linking.swift b/test/Interpreter/availability_weak_linking.swift index 67fad50b4b136..f02dd348d5850 100644 --- a/test/Interpreter/availability_weak_linking.swift +++ b/test/Interpreter/availability_weak_linking.swift @@ -114,7 +114,7 @@ func useUnavailableObjCClass() { o.someMethod() } - for var i = 0; i < getInt(5); ++i { + for var i = 0; i < getInt(5); i += 1 { if #available(OSX 1066.0, iOS 1066.0, watchOS 1066.0, tvOS 1066.0, *) { let o: UnavailableObjCClass = printClassMetadataViaGeneric() _blackHole(o) @@ -124,14 +124,14 @@ func useUnavailableObjCClass() { class SomeClass { } let someObject: AnyObject = _opaqueIdentity(SomeClass() as AnyObject) - for var i = 0; i < getInt(5); ++i { + for var i = 0; i < getInt(5); i += 1 { if #available(OSX 1066.0, iOS 1066.0, watchOS 1066.0, tvOS 1066.0, *) { let isUnavailable = someObject is UnavailableObjCClass _blackHole(isUnavailable) } } - for var i = 0; i < getInt(5); ++i { + for var i = 0; i < getInt(5); i += 1 { if #available(OSX 1066.0, iOS 1066.0, watchOS 1066.0, tvOS 1066.0, *) { let asUnavailable = someObject as? UnavailableObjCClass _blackHole(asUnavailable) diff --git a/test/Interpreter/break_continue.swift b/test/Interpreter/break_continue.swift index 2aae3a1a843eb..8643f13aeff59 100644 --- a/test/Interpreter/break_continue.swift +++ b/test/Interpreter/break_continue.swift @@ -4,7 +4,7 @@ func test1() { print("test1") var i : Int - for i=0;;++i { + for i=0;;i += 1 { if i > 2 { break } @@ -15,7 +15,7 @@ func test1() { func test2() { print("test2") var i : Int - for i=0;i<10;++i { + for i=0;i<10;i += 1 { if i > 2 { continue } @@ -25,7 +25,7 @@ func test2() { func test3() { print("test3") var i : Int - for i=0;i<10;++i { + for i=0;i<10;i += 1 { if i > 2 { break } @@ -78,7 +78,7 @@ func test7() { func test8() { print("test8") var i : Int - for i=0;;++i { + for i=0;;i += 1 { for j in 0..<10 { if j > 1 { break diff --git a/test/Interpreter/optional_lvalues.swift b/test/Interpreter/optional_lvalues.swift index fe8550ff5c1b3..68a299eccf154 100644 --- a/test/Interpreter/optional_lvalues.swift +++ b/test/Interpreter/optional_lvalues.swift @@ -4,7 +4,7 @@ var x: Int! = 0 x! = 2 print(x) // CHECK: 2 -x!++ +x! += 1 print(x) // CHECK-NEXT: 3 var sequences = ["fibonacci": [1, 1, 2, 3, 0]] diff --git a/validation-test/stdlib/ArrayNew.swift.gyb b/validation-test/stdlib/ArrayNew.swift.gyb index d3ee39a93b588..05bdd9a8481f6 100644 --- a/validation-test/stdlib/ArrayNew.swift.gyb +++ b/validation-test/stdlib/ArrayNew.swift.gyb @@ -736,7 +736,7 @@ class CustomImmutableNSArray : NSArray { @objc override func objectAtIndex(index: Int) -> AnyObject { - ++CustomImmutableNSArray.timesObjectAtIndexWasCalled + CustomImmutableNSArray.timesObjectAtIndexWasCalled += 1 return _data[index] }