File tree Expand file tree Collapse file tree 6 files changed +56
-0
lines changed Expand file tree Collapse file tree 6 files changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ struct M { int j ; };
Original file line number Diff line number Diff line change
1
+ SWIFT_SOURCES := main.swift
2
+ SWIFT_ENABLE_EXPLICIT_MODULES := Yes
3
+ SWIFT_BRIDGING_HEADER := bridging.h
4
+ SWIFTFLAGS_EXTRAS = -Xcc -I$(BUILDDIR ) /secret
5
+
6
+ all : secret.h $(EXE )
7
+
8
+ include Makefile.rules
9
+
10
+ .PHONY : secret.h
11
+
12
+ secret.h :
13
+ mkdir -p $(BUILDDIR ) /secret
14
+ echo " struct S { int i; };" > $(BUILDDIR ) /secret/secret.h
Original file line number Diff line number Diff line change
1
+ import lldb
2
+ from lldbsuite .test .decorators import *
3
+ import lldbsuite .test .lldbtest as lldbtest
4
+ import lldbsuite .test .lldbutil as lldbutil
5
+
6
+
7
+ class TestSwiftExplicitModules (lldbtest .TestBase ):
8
+ NO_DEBUG_INFO_TESTCASE = True
9
+ @swiftTest
10
+ def test (self ):
11
+ """Test explicit Swift modules with bridging headers"""
12
+ self .build ()
13
+ secret = self .getBuildArtifact ("secret" )
14
+ import shutil
15
+ shutil .rmtree (secret )
16
+
17
+ target , process , thread , bkpt = lldbutil .run_to_source_breakpoint (
18
+ self , 'Set breakpoint here' , lldb .SBFileSpec ('main.swift' ))
19
+ log = self .getBuildArtifact ("types.log" )
20
+ self .expect ('log enable lldb types -f "%s"' % log )
21
+
22
+ self .expect ("frame variable s" , substrs = ['i = 23' ])
23
+ self .expect ("frame variable m" , substrs = ['j = 42' ])
24
+ self .expect ("expression s" , substrs = ['i = 23' ])
25
+ self .expect ("expression m" , substrs = ['j = 42' ])
26
+ self .filecheck ('platform shell cat "%s"' % log , __file__ )
27
+ # CHECK: LogConfiguration
28
+ # CHECK-NOT: secret
29
+ # CHECK: Import
Original file line number Diff line number Diff line change
1
+ // A non-modular header.
2
+ #include "secret.h"
3
+ // A modular header.
4
+ #include "M.h"
Original file line number Diff line number Diff line change
1
+ func main( ) {
2
+ let s = S ( i: 23 )
3
+ let m = M ( j: 42 )
4
+ print ( s) // Set breakpoint here
5
+ }
6
+
7
+ main ( )
Original file line number Diff line number Diff line change
1
+ module M { header "M.h" }
You can’t perform that action at this time.
0 commit comments