Skip to content

Commit 7bb2d82

Browse files
committed
NFC: Update lit.cfg to specify -parse-as-library for module interface tests.
Tests that use the `%target-swift-emit-module-interface` lit substitution are designed to test the behavior of the compiler when emitting module interfaces for resilient libraries. It therefore makes sense to pass `-parse-as-library` by default for these frontend invocations. Fixes a few tests that were accidentally depending on parsing source files as top level code.
1 parent cda0fd4 commit 7bb2d82

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

test/ModuleInterface/closure.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
// CHECK: public let MyClosureVar: (Swift.Int) -> Swift.Int
1010
public let MyClosureVar: (Int) -> Int = { $0 }
1111

12-
// CHECK: public var MyOtherClosureVar: (_ x: Swift.Int) -> Swift.Int
13-
public let MyOtherClosureVar: (_ x: Int) -> Int
12+
// CHECK: public let MyOtherClosureVar: (_ x: Swift.Int) -> Swift.Int
13+
public let MyOtherClosureVar: (_ x: Int) -> Int = { x in x }

test/ModuleInterface/moveonly_interface_flag.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
7// RUN: %empty-directory(%t)
1+
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-emit-module-interface(%t/Library.swiftinterface) %s -module-name Library -enable-experimental-feature MoveOnlyResilientTypes
33
// RUN: %target-swift-typecheck-module-from-interface(%t/Library.swiftinterface) -I %t -enable-experimental-feature MoveOnlyResilientTypes
44
// RUN: %FileCheck %s < %t/Library.swiftinterface

test/lit.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2481,7 +2481,7 @@ config.substitutions.append(('%target-msvc-runtime-opt',
24812481
config.substitutions.append(('%target-swift-emit-module-interfaces\(([^)]+),\w*([^)]+)\)',
24822482
SubstituteCaptures(r'%target-swift-emit-module-interface(\1) -emit-private-module-interface-path \2')))
24832483
config.substitutions.append(('%target-swift-emit-module-interface\(([^)]+)\)',
2484-
SubstituteCaptures(r'%target-swift-frontend -swift-version 5 -enable-library-evolution -typecheck -emit-module-interface-path \1')))
2484+
SubstituteCaptures(r'%target-swift-frontend -swift-version 5 -enable-library-evolution -parse-as-library -typecheck -emit-module-interface-path \1')))
24852485

24862486
config.substitutions.append(('%target-swift-typecheck-module-from-interface\(([^)]+)\)',
24872487
SubstituteCaptures(r'%target-swift-frontend -swift-version 5 -enable-library-evolution -typecheck-module-from-interface \1')))

0 commit comments

Comments
 (0)