Skip to content

Commit 31dd56b

Browse files
committed
Add regression test.
1 parent 91e8538 commit 31dd56b

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// This test verifies that, in batch-mode (i.e. >1 primary input),
2+
// we have fixed a bug that caused every primary input to be a dependent
3+
// of every ModuleOutputPath, etc.
4+
5+
// RUN: %empty-directory(%t)
6+
// RUN: echo 'public func a() { }' >%t/a.swift
7+
// RUN: echo 'public func main() {a()}' >%t/main.swift
8+
// RUN: %target-swift-frontend -c -enable-batch-mode -bypass-batch-mode-checks -module-name foo -primary-file %t/a.swift -primary-file %t/main.swift -emit-dependencies-path %t/a.d -emit-dependencies-path %t/main.d -o %t/a.o -o %t/main.o -emit-module-path %t/a.swiftmodule -emit-module-path %t/main.swiftmodule
9+
// RUN: %FileCheck -check-prefix=CHECK-MAIN %s <%t/main.d
10+
// RUN: %FileCheck -check-prefix=NEGATIVE-MAIN %s <%t/main.d
11+
//
12+
// CHECK-MAIN-DAG: main.swiftmodule :
13+
// CHECK-MAIN-DAG: main.o :
14+
// NEGATIVE-MAIN-NOT: a.swiftmodule
15+
// NEGATIVE-MAIN-NOT: a.o
16+
//
17+
// RUN: %FileCheck -check-prefix=CHECK-A %s <%t/a.d
18+
// RUN: %FileCheck -check-prefix=NEGATIVE-A %s <%t/a.d
19+
//
20+
// CHECK-A-DAG: a.swiftmodule :
21+
// CHECK-A-DAG: a.o :
22+
// NEGATIVE-A-NOT: main.swiftmodule
23+
// NEGATIVE-A-NOT: main.o

0 commit comments

Comments
 (0)