Cleanup tests

This commit is contained in:
elsh
2021-10-13 14:52:52 -07:00
parent 1d0c84c690
commit 4b3ee94c99
4 changed files with 27 additions and 24 deletions

View File

@@ -5,6 +5,7 @@
// RUN: %empty-directory(%t)
// RUN: %{python} %utils/split_file.py -o %t %s
/// 1. AppleLogging
/// Create AppleLogging.swiftmodule by aliasing XLogging via -module-alias XLogging=AppleLogging
// RUN: %target-swift-frontend -module-name AppleLogging -module-alias XLogging=AppleLogging %t/FileLogging.swift -emit-module -emit-module-path %t/AppleLogging.swiftmodule -enable-library-evolution
@@ -16,11 +17,11 @@
// RUN: llvm-bcanalyzer --dump %t/AppleLogging.swiftmodule | %FileCheck %s -check-prefix=BCANALYZER-FOUND
// BCANALYZER-FOUND: MODULE_NAME{{.*}}AppleLogging
// RUN: not llvm-bcanalyzer --dump %t/AppleLogging.swiftmodule | %FileCheck %s -check-prefix=BCANALYZER-NOT-FOUND
// BCANALYZER-NOT-FOUND: MODULE_NAME{{.*}}XLogging
// RUN: llvm-bcanalyzer --dump %t/AppleLogging.swiftmodule | not grep XLogging
/// 2. Lib
/// Create an interface for Lib that imports XLogging with -module-alias XLogging=AppleLogging
// RUN: %target-swift-frontend -module-name Lib %t/FileLib.swift -module-alias XLogging=AppleLogging -I %t -emit-module -emit-module-path %t/Lib.swiftmodule -swift-version 5 -enable-library-evolution -I %t -Rmodule-loading 2> %t/result-Lib.output
// RUN: %target-swift-frontend -module-name Lib %t/FileLib.swift -module-alias XLogging=AppleLogging -I %t -emit-module -emit-module-interface-path %t/Lib.swiftinterface -swift-version 5 -enable-library-evolution -I %t -Rmodule-loading 2> %t/result-Lib.output
/// Check Lib.swiftinterface is created
// RUN: test -f %t/Lib.swiftinterface
@@ -30,16 +31,13 @@
/// Check AppleLogging.swiftmodule is loaded
// RUN: %FileCheck %s -input-file %t/result-Lib.output -check-prefix CHECK-LOAD
// CHECK-LOAD: remark: loaded module at {{.*}}AppleLogging.swiftmodule
/// Check XLogging.swiftmodule is not loaded
// RUN: not %FileCheck %s -input-file %t/result-Lib.output -check-prefix CHECK-NOT-LOAD
// CHECK-NOT-LOAD: remark: loaded module at {{.*}}XLogging.swiftmodule
// RUN: not %FileCheck %s -input-file %t/result-Lib.output -check-prefix CHECK-NOT-LOAD1
// CHECK-NOT-LOAD1: remark: loaded module at {{.*}}XLogging.swiftmodule
/// Check imported modules contain AppleLogging, not XLogging
// RUN: %FileCheck %s -input-file %t/Lib.swiftinterface -check-prefix CHECK-IMPORT
// CHECK-IMPORT: -module-alias XLogging=AppleLogging
// CHECK-IMPORT: import AppleLogging
// RUN: not %FileCheck %s -input-file %t/Lib.swiftinterface -check-prefix CHECK-NOT-IMPORT
// CHECK-NOT-IMPORT: import XLogging