mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Implements SE-0229. Also updates simd module types in the Apple SDKs to use the new types, and updates a couple tests to work with the new types and protocols.
32 lines
527 B
Swift
32 lines
527 B
Swift
// RUN: %target-run-simple-swift | %FileCheck %s
|
|
// REQUIRES: executable_test
|
|
// REQUIRES: OS=macosx
|
|
|
|
import simd
|
|
|
|
public struct Vector3f {
|
|
var f3: float3
|
|
init() {
|
|
f3 = float3(0, 1, 2)
|
|
}
|
|
}
|
|
|
|
public struct TwoFloat {
|
|
var f0 : Float
|
|
var f1 : Float
|
|
init() {
|
|
f0 = 0.0
|
|
f1 = 1.0
|
|
}
|
|
}
|
|
|
|
public func test() -> (Vector3f, TwoFloat) {
|
|
let v = Vector3f()
|
|
let y = TwoFloat()
|
|
let r = (v, y)
|
|
return r
|
|
}
|
|
|
|
// CHECK: (main.Vector3f(f3: SIMD3<Float>(0.0, 1.0, 2.0)), main.TwoFloat(f0: 0.0, f1: 1.0))
|
|
print(test())
|