|
| 1 | +/// Swift 6 variant to imports.swift. Both can be reintegrated once |
| 2 | +/// -swift-version 6 is accepted by release compilers. |
| 3 | +// REQUIRES: asserts |
| 4 | + |
| 5 | +// RUN: %empty-directory(%t) |
| 6 | +// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -emit-module -o %t/empty.swiftmodule %S/../Inputs/empty.swift |
| 7 | +// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -emit-module -o %t/emptyButWithLibraryEvolution.swiftmodule %S/../Inputs/empty.swift -enable-library-evolution |
| 8 | + |
| 9 | +/// Swift 6 variant. |
| 10 | +// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s %S/Inputs/imports-other.swift -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -I %S/Inputs/imports-clang-modules/ -I %t -verify -swift-version 6 |
| 11 | +// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -I %S/Inputs/imports-clang-modules/ -I %t |
| 12 | +// RUN: %FileCheck -implicit-check-not BAD -check-prefix CHECK-6 %s < %t.swiftinterface |
| 13 | + |
| 14 | +@_exported import empty // expected-warning {{module 'empty' was not compiled with library evolution support; using it means binary compatibility for 'main' can't be guaranteed}} |
| 15 | +@_exported import emptyButWithLibraryEvolution |
| 16 | +import B.B2 |
| 17 | +import func C.c // expected-warning {{scoped imports are not yet supported in module interfaces}} |
| 18 | +import D |
| 19 | +@_implementationOnly import Secret_BAD |
| 20 | + |
| 21 | +@_implementationOnly import NotSoSecret // expected-note {{imported as implementation-only here}} |
| 22 | +import NotSoSecret2 // expected-warning {{'NotSoSecret2' inconsistently imported as implementation-only}} |
| 23 | + |
| 24 | +// CHECK-6-NOT: import |
| 25 | +// CHECK-6: {{^}}public import A{{$}} |
| 26 | +// CHECK-6-NEXT: {{^}}public import B{{$}} |
| 27 | +// CHECK-6-NEXT: {{^}}public import B.B2{{$}} |
| 28 | +// CHECK-6-NEXT: {{^}}public import B.B3{{$}} |
| 29 | +// CHECK-6-NEXT: {{^}}public import C/*.c*/{{$}} |
| 30 | +// CHECK-6-NEXT: {{^}}public import D{{$}} |
| 31 | +// CHECK-6-NEXT: {{^}}public import NotSoSecret{{$}} |
| 32 | +// CHECK-6-NEXT: {{^}}public import NotSoSecret2{{$}} |
| 33 | +// CHECK-6-NEXT: {{^}}public import Swift{{$}} |
| 34 | +// CHECK-6-NEXT: {{^}}@_exported public import empty{{$}} |
| 35 | +// CHECK-6-NEXT: {{^}}@_exported public import emptyButWithLibraryEvolution{{$}} |
| 36 | +// CHECK-6-NOT: import |
0 commit comments