Files
swift-mirror/test/Interpreter/SDK/class_as_object.swift
Arnold Schwaighofer 3643c614a3 Run tests in optimize test modes
This runs all files that have a target-build-swift or target-run-stdlib-swift
RUN line in optimize test mode.

Swift SVN r29206
2015-06-01 21:23:31 +00:00

28 lines
641 B
Swift

// Also run this test in optimize test modes.
// REQUIRES: optimize_test
// RUN: rm -rf %t && mkdir %t
// RUN: %target-build-swift %s -o %t/a.out
// RUN: %target-run %t/a.out | FileCheck %s
// REQUIRES: objc_interop
import Foundation
let classes = NSMutableArray()
classes.addObject(NSObject.self)
classes.addObject(NSString.self)
classes.addObject(NSNumber.self)
for obj: AnyObject in classes {
print(obj.description)
}
// CHECK: NSObject
// CHECK-NEXT: NSString
// CHECK-NEXT: NSNumber
print(NSObject.conformsToProtocol(NSCopying.self))
// CHECK-NEXT: false
print(NSString.conformsToProtocol(NSCopying.self))
// CHECK-NEXT: true