mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +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>
19 lines
758 B
Swift
19 lines
758 B
Swift
// RUN: %target-swift-frontend %s -emit-ir -g -o - | %FileCheck %s
|
|
|
|
// These two should not have the same type.
|
|
// CHECK: !DIGlobalVariable(name: "a",{{.*}} line: [[@LINE+2]]
|
|
// CHECK-SAME: type: ![[INT64:[0-9]+]]
|
|
var a : Int64 = 2
|
|
// CHECK: ![[INT64]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Int64"
|
|
// CHECK-SAME: size: 64,
|
|
// CHECK-NOT: offset: 0
|
|
// CHECK-NOT: DIFlagFwdDecl
|
|
// CHECK-SAME: identifier: "_T0s5Int64VD"
|
|
|
|
// CHECK: !DIGlobalVariable(name: "b",{{.*}} line: [[@LINE+2]]
|
|
// CHECK-SAME: type: ![[INT:[0-9]+]]
|
|
var b = 2
|
|
// CHECK: ![[INT]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Int"
|
|
// CHECK-SAME: identifier: "_T0SiD"
|
|
|