mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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
|