Files
swift-mirror/test/Driver/emit-interface.swift
Allan Shortlidge 5186971a02 Frontend: Introduce -experimental-serialize-external-decls-only option.
This option is designed to be used in conjunction with
`-experimental-lazy-typecheck` and `-experimental-skip-all-function-bodies`
when emitting a resilient module. The emitted binary module should contain only
the decls needed by clients and should contain roughly the same contents as it
would if the corresponding swiftinterface were emitted instead and then built.

This functionality is a work in progress. Some parts of the AST may still get
typechecked unnecessarily. Additionally, serialization does not trigger the
appropriate typechecking requests for some ASTs and then fails due to missing
types.

Resolves rdar://114230586
2023-08-28 21:22:20 -07:00

29 lines
1.7 KiB
Swift

// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 %s -emit-module-interface -o %t/foo 2>&1 | %FileCheck %s
// CHECK: swift{{(-frontend|c)?(\.exe)?"?}} -frontend
// CHECK-SAME: emit-interface.swift
// CHECK: swift{{(-frontend|c)?(\.exe)?"?}} -frontend -merge-modules
// CHECK-SAME: -emit-module-interface-path {{.+[/\\]}}foo.swiftinterface
// CHECK: {{(bin/)?}}ld
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 %s -emit-module-interface -o %t/foo -whole-module-optimization 2>&1 | %FileCheck -check-prefix=CHECK-WHOLE-MODULE %s
// CHECK-WHOLE-MODULE: swift{{(-frontend|c)?(\.exe)?"?}} -frontend
// CHECK-WHOLE-MODULE-SAME: emit-interface.swift
// CHECK-WHOLE-MODULE-SAME: -emit-module-interface-path {{.+[/\\]}}foo.swiftinterface
// CHECK-WHOLE-MODULE-NOT: -merge-modules
// CHECK-WHOLE-MODULE: {{(bin/)?}}ld
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 %s -emit-module-interface-path %t/unrelated.swiftinterface -o %t/foo -whole-module-optimization 2>&1 | %FileCheck -check-prefix=CHECK-EXPLICIT-PATH %s
// CHECK-EXPLICIT-PATH: swift{{(-frontend|c)?(\.exe)?"?}} -frontend
// CHECK-EXPLICIT-PATH-SAME: emit-interface.swift
// CHECK-EXPLICIT-PATH-SAME: -emit-module-interface-path {{.+[/\\]}}unrelated.swiftinterface
// Ensure that we emit arguments when we force filelists as well
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 %s -emit-module-interface -o %t/foo -module-name foo -whole-module-optimization -driver-filelist-threshold=0 2>&1 | %FileCheck -check-prefix=CHECK-FILELIST %s
// CHECK-FILELIST: swift{{(-frontend|c)?(\.exe)?"?}} -frontend
// CHECK-FILELIST-SAME: -supplementary-output-file-map
// CHECK-FILELIST-NOT: emit-interface.swift{{ }}