Files
swift-mirror/test/1_stdlib/integer_conversions.swift
Jordan Rose e83c117c30 [test] Hack: run stdlib tests first to start long-running tests earlier.
This decreases total testing time by over a minute on my old Mac Pro.
It probably has much less effect on systems with fewer cores, but shouldn't
be any worse there.

Swift SVN r22745
2014-10-15 01:30:51 +00:00

42 lines
593 B
Swift

// RUN: %target-run-simple-swift | FileCheck %s
var a : Int
func test_Int8() {
var i8 : Int8
i8 = -0x1
println(Int(i8))
}
func test_UInt8() {
var ui8 : UInt8
ui8 = 0xFF
println(ui8)
var i8 = Int8(bitPattern: ui8)
println(Int(i8))
}
func test_UInt32() {
var ui32 : UInt32
ui32 = 0xFFFFFFFF
println(ui32)
var i8 : Int8
i8 = Int8(ui32 & (0xF))
println(String(i8))
}
test_Int8()
test_UInt8()
test_UInt32()
var tentwenty : UInt64
tentwenty = 1000
tentwenty += 20
println(tentwenty)
// CHECK: -1
// CHECK: 255
// CHECK: 4294967295
// CHECK: 15
// CHECK: 1020