Files
swift-mirror/test/DebugInfo/vector.swift
Stephen Canon 8e11af4012 Make the naming of underlying builtin for FP + Vector match Integer. (#15430)
* Make the underlying builtins for FP + Vector match Integer.

For stdlib integer types, these are named `_value` and `init(_ _value: Builtin.xxx)`. This patch adopts the same scheme for stdlib floating point and SDK overlay vector types, and removes a legacy init for integers that was only needed to support them. There should be no changes visible outside of the stdlib, and no functional change within the stdlib; the naming of some implementation details is simply more uniform now.
2018-03-22 16:43:20 -04:00

21 lines
681 B
Swift

// RUN: %target-swift-frontend -emit-ir -g %s -o - -parse-stdlib | %FileCheck %s
// REQUIRES: OS=macosx
// CHECK: !DICompositeType(tag: DW_TAG_array_type, baseType: ![[FLOAT:[0-9]+]], size: 64, flags: DIFlagVector, elements: ![[ELTS:[0-9]+]])
// CHECK: ![[FLOAT]] = !DIBasicType(name: "$SBf32_D", size: 32, encoding: DW_ATE_float)
// CHECK: ![[ELTS]] = !{![[SR:[0-9]+]]}
// CHECK: ![[SR]] = !DISubrange(count: 2)
import Swift
public struct float2 {
public var _vector: Builtin.Vec2xFPIEEE32
public subscript(index: Int) -> Float {
get {
let elt = Builtin.extractelement_Vec2xFPIEEE32_Int32(_vector,
Int32(index)._value)
return Float(elt)
}
}
}