   printState(w)                           // CHECK-NEXT: is present
   c.noop()                                // CHECK-NEXT: noop
   c = ObjCClassBase()                     // CHECK-NEXT: ObjCClass Destroyed
-  w = nil
   printState(w)                           // CHECK-NEXT: is nil
 }
 

  printState(w)                           // CHECK-NEXT: is present
  c.noop()                                // CHECK-NEXT: noop
  c = SwiftClassBase()                    // CHECK-NEXT: SwiftClass Destroyed
  w = nil
  printState(w)                           // CHECK-NEXT: is nil
}


}

func testProtocol() {
  println("testProtocol")                 // CHECK: testProtocol
  
  weak var w : Protocol?
  printState(w)                           // CHECK-NEXT: is nil
  var c : SwiftClassBase = SwiftClass()   // CHECK: SwiftClass Created
  printState(w)                           // CHECK-NEXT: is nil
  w = c
  printState(w)                           // CHECK-NEXT: is present
  c.noop()                                // CHECK-NEXT: noop
  c = SwiftClassBase()                    // CHECK-NEXT: SwiftClass Destroyed
  printState(w)                           // CHECK-NEXT: is nil
}

testProtocol()
