Files
swift-mirror/test/DebugInfo/alignment.swift
Adrian Prantl 8e6d6338ce Emit debug info for Swift types using the default alignment where possible.
This patch emits the alignment for all default-aligned types as 0
which causes the backend to not emit an alignment attribute at
all. This mirrors clang's behavior.

<rdar://problem/29007471>
2017-04-17 11:35:33 -07:00

18 lines
418 B
Swift

// RUN: %target-swift-frontend %s -emit-ir -g -o - | %FileCheck %s
@_alignment(32)
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "S32"
// CHECK-SAME: align: 256,
struct S32 { var x, y, z, w: Float }
@_alignment(16)
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "E16"
// CHECK-SAME: align: 128,
enum E16 {
case F(Float)
case I(Int64)
}
var s: S32
var e: E16