Skip to content

Commit b7edb16

Browse files
committed
[Frontend] Add test that we can create a module if same filename is used twice and -experimental-allow-module-with-compiler-errors is passed
1 parent e2135e9 commit b7edb16

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
class Foo {}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
class Bar {}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// RUN: %empty-directory(%t)
2+
3+
// A module should fail to be generated if the same filename is used twice and '-experimental-allow-module-with-compiler-errors' is not passed
4+
5+
// RUN: not %target-swift-frontend -emit-module -o %t/no_allow_compiler_errors.swiftmodule %S/Inputs/same_filename/A/File.swift %S/Inputs/same_filename/B/File.swift
6+
// RUN: not ls %t/no_allow_compiler_errors.swiftmodule
7+
8+
// If '-experimental-allow-module-with-compiler-errors' is passed, we should throw an error but still generate a module
9+
10+
// RUN: %target-swift-frontend -emit-module -experimental-allow-module-with-compiler-errors -o %t/allow_compiler_errors.swiftmodule %S/Inputs/same_filename/A/File.swift %S/Inputs/same_filename/B/File.swift 2>&1 | %FileCheck %s
11+
// RUN: ls %t/allow_compiler_errors.swiftmodule
12+
13+
// CHECK: filename "File.swift" used twice:

0 commit comments

Comments
 (0)