File tree Expand file tree Collapse file tree 4 files changed +61
-0
lines changed
lldb/test/API/lang/swift/objc_implementation Expand file tree Collapse file tree 4 files changed +61
-0
lines changed Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
1
+ SWIFT_SOURCES = main.swift
2
+ SWIFT_BRIDGING_HEADER = Gadget.h
3
+ SWIFT_PRECOMPILE_BRIDGING_HEADER = NO
4
+ include Makefile.rules
Original file line number Diff line number Diff line change
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"' ])
Original file line number Diff line number Diff line change
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 ( )
You can’t perform that action at this time.
0 commit comments