Files
swift-mirror/test/ScanDependencies/explicit-interface-build.swift
Artem Chikin 4cdbcb8645 [Explicit Module Builds] Always rebuild the target module in explicit -compile-module-from-interface builds.
We have long switched to delegate the checking of whether a module is up-to-date to the build system (SwiftDriver) and stopped serializing file dependencies for interface-built binary modules.

Resolves rdar://162881032
2025-10-20 14:13:37 -07:00

26 lines
1.1 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: %empty-directory(%t/module-cache)
// RUN: %empty-directory(%t/Foo.swiftmodule)
// RUN: split-file %s %t
// Build module from interface
// RUN: %target-swift-frontend -compile-module-from-interface -o %t/Foo.swiftmodule/Foo.swiftmodule -module-name Foo %t/Foo.swiftmodule/Foo.swiftinterface -explicit-interface-module-build
// Add to the textual interface
// RUN: echo "struct GoodBye {}" >> %t/Foo.swiftmodule/Foo.swiftinterface
// Build module from interface
// RUN: %target-swift-frontend -compile-module-from-interface -o %t/Foo.swiftmodule/Foo.swiftmodule -module-name Foo %t/Foo.swiftmodule/Foo.swiftinterface -explicit-interface-module-build
// Get the list of strings and ensure the binary module reflects the new addition
// RUN: %llvm-strings %t/Foo.swiftmodule/Foo.swiftmodule > %t/module_strings.txt
// RUN: cat %t/module_strings.txt | %FileCheck %s
// CHECK-DAG: Hello
// CHECK-DAG: GoodBye
//--- Foo.swiftmodule/Foo.swiftinterface
// swift-interface-format-version: 1.0
// swift-module-flags: -module-name Foo
struct Hello {}