Files
swift-mirror/test/Interpreter/SDK/CGImportAsMember.swift
Michael Ilseman 151a19d3b8 [Import as member] Fixes to apinotes and tests
Fixes and clarifies a few API notes, and adds some test cases showing
current SILGen issues.
2016-04-11 11:31:12 -07:00

52 lines
1.5 KiB
Swift

// RUN: %target-run-simple-swift | FileCheck %s
// REQUIRES: executable_test
// REQUIRES: OS=macosx
// XFAIL:
import Foundation
import CoreGraphics
class Colors {
// TODO: when issue is fixed, migrate these to CGColor class properties
static var black = CGColor.constantColorForName(kCGColorBlack)!
static var white = CGColor.constantColorForName(kCGColorWhite)!
// FIXME: this triggers an assert in SILVerifier
static var clear = CGColor.constantColorForName(CGColor.clear)!
class func printColors() {
print("Colors") // CHECK: Colors
print(black) // CHECK: Generic Gray Profile
print(white) // CHECK: Generic Gray Profile
print(clear)
}
}
// TODO: ColorSpaces with their empty-argument-label pattern, when issue is
// fixed.
class Events {
static var mouseDefault = CGEventMouseSubtype.defaultType
static var mouseTabletPoint = CGEventMouseSubtype.tabletPoint
static var tapDefault = CGEventTapOptions.defaultTap
static var tapListenOnly = CGEventTapOptions.listenOnly
static var privateID = CGEventSourceStateID.privateState
static var combinedSessionID = CGEventSourceStateID.combinedSessionState
class func printEvents() {
print("Events") // CHECK-LABEL: Events
print(mouseDefault.rawValue) // CHECK: 0
print(mouseTabletPoint.rawValue) // CHECK: 1
print(tapDefault.rawValue) // CHECK: 0
print(tapListenOnly.rawValue) // CHECK: 1
print(privateID.rawValue) // CHECK: -1
print(combinedSessionID.rawValue) // CHECK: 0
}
}
Colors.printColors()
Events.printEvents()