mirror of
https://github.com/apple/swift.git
synced 2026-06-27 12:25:55 +02:00
8e6d6338ce
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>
18 lines
418 B
Swift
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
|