   }
 }
 
-// CHECK: String: hello
+// CHECK-NEXT: String: hello
 testAnyObjectDowncast("hello")
 
-// CHECK: Int: 5
+// CHECK-NEXT: Int: 5
 testAnyObjectDowncast(5)
 
-// CHECK: NSString array: [hello, swift, world]
+// CHECK-NEXT: NSString array: [hello, swift, world]
 testAnyObjectDowncast(["hello", "swift", "world"] as NSArray)
 
-// CHECK: Int array: [1, 2, 3, 4, 5]
+// CHECK-NEXT: Int array: [1, 2, 3, 4, 5]
 testAnyObjectDowncast([1, 2, 3, 4, 5])
 
 // CHECK: Dictionary<String, Int>: [

import Foundation

func testAnyObjectIsa(obj: AnyObject) {

  if obj is String {
    println("String")
  }
  else if obj is Int {
    println("Int")
  }
  else if obj is [NSString] {
    println("[NSString]")
  }
  else if obj is [Int] {
    println("[Int]")
  }
  else if obj is Dictionary<String, Int> {
    println("Dictionary<String, Int>")
  }
  else {
    println("Did not match")
  }
}

// CHECK: String
testAnyObjectIsa("hello")

// CHECK: Int
testAnyObjectIsa(5)

// CHECK: [NSString]
testAnyObjectIsa(["hello", "swift", "world"])

// CHECK: [Int]
testAnyObjectIsa([1, 2, 3, 4, 5])

// CHECK: Dictionary<String, Int>
testAnyObjectIsa(["hello" : 1, "world" : 2])

func testNSArrayIsa(nsArr: NSArray) {
  if nsArr is [String] {
    println("[String]")
  }
  else if nsArr is [Int] {
    println("[Int]")
  }
  else {
    println("Did not match")
  }
}

// CHECK: [String]
testNSArrayIsa(["a", "b", "c"])

// CHECK: [Int]
testNSArrayIsa([1, 2, 3])

// CHECK: Did not match
testNSArrayIsa([[1, 2], [3, 4], [5, 6]])

func testArrayIsa(arr: Array<AnyObject>) {
  if arr is [NSString] {
    println("[NSString]")
  }
  else if arr is [NSNumber] {
    println("[NSNumber]")
  }
  else {
    println("Did not match")
  }
}

// CHECK: [NSString]
testArrayIsa(["a", "b", "c"])

// CHECK: [NSNumber]
testArrayIsa([1, 2, 3])

// CHECK: Did not match
testArrayIsa([[1, 2], [3, 4], [5, 6]])

func testArrayIsaBridged(arr: Array<AnyObject>) {
  if arr is [String] {
    println("[String]")
  }
  else if arr is [Int] {
    println("[Int]")
  }
  else {
    println("Did not match");
  }
}

// CHECK: [String]
testArrayIsaBridged(["a", "b", "c"])

// CHECK: [Int]
testArrayIsaBridged([1, 2, 3])

// CHECK: Did not match
testArrayIsaBridged([[1, 2], [3, 4], [5, 6]])

func testNSMutableStringMatch(sa: NSMutableString) {

  }
}

// CHECK-NEXT: MATCH
testNSMutableStringMatch("foobar")

// CHECK-NEXT: nomatch
testNSMutableStringMatch("nope")

func testAnyObjectDowncast(obj: AnyObject!) {
