From 472644e335c9f92792c13125479131335533d8f2 Mon Sep 17 00:00:00 2001 From: "Henrik G. Olsson" Date: Mon, 22 Sep 2025 14:58:47 -0700 Subject: [PATCH] [Interop] Fix tests relying on transitive module imports (NFC) --- .../Inputs/TransitiveModules/module.modulemap | 24 ----------------- .../C/swiftify-import/Inputs/module.modulemap | 26 +++++++++++++++++++ .../clang-includes-aliasing-imports.swift | 4 +-- ...g-includes-indirect-explicit-modules.swift | 6 ++--- .../clang-includes-redundant-imports.swift | 22 ++++++++-------- 5 files changed, 42 insertions(+), 40 deletions(-) delete mode 100644 test/Interop/C/swiftify-import/Inputs/TransitiveModules/module.modulemap diff --git a/test/Interop/C/swiftify-import/Inputs/TransitiveModules/module.modulemap b/test/Interop/C/swiftify-import/Inputs/TransitiveModules/module.modulemap deleted file mode 100644 index 7c3b96f1111b9..0000000000000 --- a/test/Interop/C/swiftify-import/Inputs/TransitiveModules/module.modulemap +++ /dev/null @@ -1,24 +0,0 @@ -module ModuleA { - header "module-a.h" - export * -} -module ModuleB { - header "module-b.h" -} -module ModuleOuter { - module ModuleC { - header "module-c.h" - export * - } - explicit module ModuleD { - header "module-d.h" - export * - } -} -module ModuleDeep { - module ModuleDeepNested { - module ModuleDeepNestedNested { - header "module-e.h" - } - } -} diff --git a/test/Interop/C/swiftify-import/Inputs/module.modulemap b/test/Interop/C/swiftify-import/Inputs/module.modulemap index 93416d69a4a97..29c1c6b295413 100644 --- a/test/Interop/C/swiftify-import/Inputs/module.modulemap +++ b/test/Interop/C/swiftify-import/Inputs/module.modulemap @@ -33,3 +33,29 @@ module ClangIncludesModule { module ClangIncludesNoExportModule { header "clang-includes.h" } + +// TransitiveModules/ +module ModuleA { + header "TransitiveModules/module-a.h" + export * +} +module ModuleB { + header "TransitiveModules/module-b.h" +} +module ModuleOuter { + module ModuleC { + header "TransitiveModules/module-c.h" + export * + } + explicit module ModuleD { + header "TransitiveModules/module-d.h" + export * + } +} +module ModuleDeep { + module ModuleDeepNested { + module ModuleDeepNestedNested { + header "TransitiveModules/module-e.h" + } + } +} diff --git a/test/Interop/C/swiftify-import/clang-includes-aliasing-imports.swift b/test/Interop/C/swiftify-import/clang-includes-aliasing-imports.swift index 6e4419de54413..13588c6d76abd 100644 --- a/test/Interop/C/swiftify-import/clang-includes-aliasing-imports.swift +++ b/test/Interop/C/swiftify-import/clang-includes-aliasing-imports.swift @@ -6,8 +6,8 @@ // RUN: %target-swift-frontend -dump-source-file-imports -emit-module -plugin-path %swift-plugin-dir -o %t/ClangIncludesExplicit.swiftmodule -I %t/Inputs -enable-experimental-feature SafeInteropWrappers %t/test.swift 2>&1 | %FileCheck %s --check-prefix DUMP // RUN: %target-swift-frontend -dump-source-file-imports -emit-module -plugin-path %swift-plugin-dir -o %t/ClangIncludesExplicit.swiftmodule -I %t/Inputs -enable-experimental-feature SafeInteropWrappers %t/test.swift -cxx-interoperability-mode=default 2>&1 | %FileCheck %s --check-prefix DUMP --check-prefix DUMP-CXX -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-A1 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A2 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-A2 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-A1 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A2 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-A2 --implicit-check-not=import --match-full-lines //--- test.swift import A1 diff --git a/test/Interop/C/swiftify-import/clang-includes-indirect-explicit-modules.swift b/test/Interop/C/swiftify-import/clang-includes-indirect-explicit-modules.swift index e6131d7cee542..35a934ec4d2a8 100644 --- a/test/Interop/C/swiftify-import/clang-includes-indirect-explicit-modules.swift +++ b/test/Interop/C/swiftify-import/clang-includes-indirect-explicit-modules.swift @@ -6,10 +6,10 @@ // RUN: %target-swift-frontend -dump-source-file-imports -emit-module -plugin-path %swift-plugin-dir -o %t/ClangIncludesExplicit.swiftmodule -I %t/Inputs -enable-experimental-feature SafeInteropWrappers %t/test.swift 2>&1 | %FileCheck %s --check-prefix DUMP // RUN: %target-swift-frontend -dump-source-file-imports -emit-module -plugin-path %swift-plugin-dir -o %t/ClangIncludesExplicit.swiftmodule -I %t/Inputs -enable-experimental-feature SafeInteropWrappers %t/test.swift -cxx-interoperability-mode=default 2>&1 | %FileCheck %s --check-prefix DUMP --check-prefix DUMP-CXX -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.B1 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-B1 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.B1.C1 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-C1 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.B1 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-B1 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.B1.C1 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-C1 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A2.B2 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-B2 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A2.B2 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-B2 --implicit-check-not=import --match-full-lines //--- test.swift import A1.B1 diff --git a/test/Interop/C/swiftify-import/clang-includes-redundant-imports.swift b/test/Interop/C/swiftify-import/clang-includes-redundant-imports.swift index 34fec7dfc97e2..0ea13db6ee4c4 100644 --- a/test/Interop/C/swiftify-import/clang-includes-redundant-imports.swift +++ b/test/Interop/C/swiftify-import/clang-includes-redundant-imports.swift @@ -6,17 +6,17 @@ // RUN: %target-swift-frontend -dump-source-file-imports -emit-module -plugin-path %swift-plugin-dir -o %t/ClangIncludesExplicit.swiftmodule -I %t/Inputs -enable-experimental-feature SafeInteropWrappers %t/test.swift 2>&1 | %FileCheck %s --check-prefix DUMP // RUN: %target-swift-frontend -dump-source-file-imports -emit-module -plugin-path %swift-plugin-dir -o %t/ClangIncludesExplicit.swiftmodule -I %t/Inputs -enable-experimental-feature SafeInteropWrappers %t/test.swift -cxx-interoperability-mode=default 2>&1 | %FileCheck %s --check-prefix DUMP --check-prefix DUMP-CXX -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-A1 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.B1 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-B1 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.B1.C1 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-C1 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.B1.C1.D1 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-D1 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.E1 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-E1 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.E1.F1 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-F1 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.E1.G1 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-G1 --implicit-check-not=import --match-full-lines - -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A2.B2 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-B2 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A2.B2.C2 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-C2 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A2.B2.C2.D2 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-D2 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-A1 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.B1 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-B1 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.B1.C1 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-C1 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.B1.C1.D1 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-D1 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.E1 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-E1 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.E1.F1 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-F1 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.E1.G1 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-G1 --implicit-check-not=import --match-full-lines + +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A2.B2 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-B2 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A2.B2.C2 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-C2 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A2.B2.C2.D2 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-D2 --implicit-check-not=import --match-full-lines //--- test.swift import A1