Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
IRGen: Set instanceStart correctly in ObjC rodata when first stored property is empty.
- Loading branch information
Showing
4 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// RUN: %target-swift-frontend -primary-file %s -emit-ir | FileCheck %s --check-prefix=CHECK-%target-ptrsize | ||
|
||
// REQUIRES: objc_interop | ||
|
||
// SR-1055 | ||
|
||
// CHECK-64: @_DATA__TtC23objc_class_empty_fields14OneEnumWrapper = private constant { {{.*}}* } { i32 {{[0-9]+}}, i32 16, i32 24 | ||
// CHECK-32: @_DATA__TtC23objc_class_empty_fields14OneEnumWrapper = private constant { {{.*}}* } { i32 {{[0-9]+}}, i32 12, i32 16 | ||
|
||
enum OneCaseEnum { | ||
case X | ||
} | ||
|
||
class OneEnumWrapper { | ||
var myVar: OneCaseEnum | ||
var whyVar: OneCaseEnum | ||
var x: Int | ||
|
||
init(v: OneCaseEnum) | ||
{ | ||
self.myVar = v | ||
self.whyVar = v | ||
self.x = 0 | ||
} | ||
} | ||
|
||
let e = OneCaseEnum.X | ||
print(e) | ||
let x = OneEnumWrapper(v: e) | ||
print(x) |