Skip to content

Commit a401bac

Browse files
author
git apple-llvm automerger
committed
Merge commit '562f2c15d6e9' from swift/release/6.2 into stable/20240723
2 parents 91adf08 + 562f2c1 commit a401bac

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#import <Foundation/Foundation.h>
2+
3+
NS_ASSUME_NONNULL_BEGIN
4+
5+
@interface Gadget : NSObject
6+
@property(nonatomic, assign) NSInteger integer;
7+
@property(nonatomic, assign) BOOL boolean;
8+
@property(nonatomic, strong) NSObject *object;
9+
@property(nonatomic, copy) NSString *string;
10+
@property(nonatomic, copy) NSObject *stringObject;
11+
@end
12+
13+
NS_ASSUME_NONNULL_END
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
SWIFT_SOURCES = main.swift
2+
SWIFT_BRIDGING_HEADER = Gadget.h
3+
SWIFT_PRECOMPILE_BRIDGING_HEADER = NO
4+
include Makefile.rules
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import lldb
2+
from lldbsuite.test.lldbtest import *
3+
from lldbsuite.test.decorators import *
4+
import lldbsuite.test.lldbutil as lldbutil
5+
6+
7+
class TestCase(TestBase):
8+
9+
@swiftTest
10+
@skipUnlessFoundation
11+
def test(self):
12+
self.build()
13+
lldbutil.run_to_source_breakpoint(
14+
self, "break here", lldb.SBFileSpec("main.swift")
15+
)
16+
self.expect(
17+
"frame var g",
18+
substrs=[
19+
"integer = 15",
20+
"object = some",
21+
'stringObject = "Joker"',
22+
],
23+
# On x86_64, BOOL types have an objc encoding of 'c', which is a
24+
# signed char. The result is in an output of '\x01'.
25+
patterns=[r"boolean = (true|'\\x01')"],
26+
)
27+
# Swift types that are not representable in ObjC (bridged types such as
28+
# String) are not currently listed in the children. rdar://154046212
29+
self.expect("frame var g", matching=False, substrs=['string = "Ace"'])
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@objc @implementation
2+
extension Gadget {
3+
var integer: Int = 15
4+
var boolean: Bool = true
5+
var object: NSObject = NSObject()
6+
var string: String = "Ace"
7+
var stringObject: NSObject = "Joker" as NSString
8+
}
9+
10+
func main() {
11+
let g = Gadget()
12+
print("break here")
13+
}
14+
15+
main()

0 commit comments

Comments
 (0)