Files
swift-mirror/test/Serialization/struct.swift
Dmitri Hrybenko 3b04d1b013 tests: reorganize tests so that they actually use the target platform
Most tests were using %swift or similar substitutions, which did not
include the target triple and SDK.  The driver was defaulting to the
host OS.  Thus, we could not run the tests when the standard library was
not built for OS X.

Swift SVN r24504
2015-01-19 06:52:49 +00:00

70 lines
1.4 KiB
Swift

// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/def_struct.swift
// RUN: llvm-bcanalyzer %t/def_struct.swiftmodule | FileCheck %s
// RUN: %target-swift-frontend -emit-silgen -I %t %s -o /dev/null
// CHECK-NOT: UnknownCode
import def_struct
var a : Empty
var b = TwoInts(x: 1, y: 2)
var c : ComputedProperty
var sum = b.x + b.y + c.value
var intWrapper = ResettableIntWrapper(value: b.x)
var r : Resettable = intWrapper
r.reset()
struct AnotherIntWrapper : SpecialResettable {
var value : Int
mutating
func reset() {
value = 0
}
mutating
func compute() {
value = 42
}
}
var intWrapper2 = AnotherIntWrapper(value: 42)
r = intWrapper2
r.reset()
var cached : Cacheable = intWrapper2
cached.compute()
cached.reset()
var p = Pair(a: 1, b: 2.5)
p.first = 2
p.second = 5.0
var gc = GenericCtor<Int>()
gc.doSomething()
var wrappedTypeVar : ComputableWrapper<AnotherIntWrapper>.ComputableType
wrappedTypeVar = intWrapper2
cacheViaWrappers(ComputableWrapper<AnotherIntWrapper>(),
ResettableWrapper<AnotherIntWrapper>())
var simpleSub = ReadonlySimpleSubscript()
var subVal = simpleSub[4]
var complexSub = ComplexSubscript()
complexSub[4, false] = complexSub[3, true]
a.doAbsolutelyNothing()
var comp : Computable = UnComputable(x: 42)
var condition = UnComputable.canCompute()
var revP = p.swap()
func testMasterConformanceMap(x: Int32) -> Bool {
return x != -1
}