[Test] Make more permissive checks against the format of -Rmodule-loading

This commit is contained in:
Alexis Laferrière
2022-11-17 16:58:49 -08:00
parent f184504d62
commit ed877ff0f2
7 changed files with 23 additions and 23 deletions

View File

@@ -14,7 +14,7 @@
// RUN: %target-swift-frontend -module-name LibA %t/FileLib.swift -module-alias XLogging=AppleLogging -I %t -emit-module -emit-module-path %t/LibA.swiftmodule -Rmodule-loading 2> %t/result-LibA.output
// RUN: test -f %t/LibA.swiftmodule
// RUN: %FileCheck %s -input-file %t/result-LibA.output -check-prefix CHECK-LOAD
// CHECK-LOAD: remark: loaded module at {{.*}}AppleLogging.swiftmodule
// CHECK-LOAD: remark: loaded module {{.*}}AppleLogging.swiftmodule
/// 2. Fail: trying to access a non-member of a module (with module aliasing) should fail with the module alias in the diags
/// Try building module Lib that imports XLogging WITH -module-alias XLogging=AppleLogging

View File

@@ -48,4 +48,4 @@
// RUN: not test -f %t/inputs/Cat.swiftmodule
// RUN: %FileCheck %s -input-file %t/outputs/load-result.output -check-prefix CHECK
// CHECK: remark: loaded module at {{.*}}Bar.swiftmodule
// CHECK: remark: loaded module {{.*}}Bar.swiftmodule

View File

@@ -22,7 +22,7 @@
/// Check Lib.swiftmodule is created and AppleLogging.swiftmodule is loaded
// RUN: test -f %t/Lib.swiftmodule
// RUN: %FileCheck %s -input-file %t/result-Lib.output -check-prefix CHECK-Lib
// CHECK-Lib: remark: loaded module at {{.*}}AppleLogging.swiftmodule
// CHECK-Lib: remark: loaded module {{.*}}AppleLogging.swiftmodule
/// 3a. Client1
/// Create module Client1 that imports Lib and XLogging, WITHOUT module aliasing for XLogging
@@ -31,8 +31,8 @@
/// Check Client1.swiftmodule is created and Lib.swiftmodule and XLogging.swiftmodule are loaded
// RUN: test -f %t/Client1.swiftmodule
// RUN: %FileCheck %s -input-file %t/result-Client1.output -check-prefix CHECK-1
// CHECK-1: remark: loaded module at {{.*}}XLogging.swiftmodule
// CHECK-1: remark: loaded module at {{.*}}Lib.swiftmodule
// CHECK-1: remark: loaded module {{.*}}XLogging.swiftmodule
// CHECK-1: remark: loaded module {{.*}}Lib.swiftmodule
/// 3b. Client2
/// Create a module Client2 that imports Lib and XLogging, WITH module aliasing for XLogging
@@ -42,10 +42,10 @@
/// loaded but XLogging.swiftmodule is not loaded.
// RUN: test -f %t/Client2.swiftmodule
// RUN: %FileCheck %s -input-file %t/result-Client2.output -check-prefix CHECK-2A
// CHECK-2A: remark: loaded module at {{.*}}AppleLogging.swiftmodule
// CHECK-2A: remark: loaded module at {{.*}}Lib.swiftmodule
// CHECK-2A: remark: loaded module {{.*}}AppleLogging.swiftmodule
// CHECK-2A: remark: loaded module {{.*}}Lib.swiftmodule
// RUN: not %FileCheck %s -input-file %t/result-Client2.output -check-prefix CHECK-2B
// CHECK-2B: remark: loaded module at {{.*}}XLogging.swiftmodule
// CHECK-2B: remark: loaded module {{.*}}XLogging.swiftmodule
// BEGIN FileLogging.swift

View File

@@ -23,9 +23,9 @@
// RUN: not test -f %t/XLogging.swiftmodule
// RUN: %FileCheck %s -input-file %t/result-Lib.output -check-prefix CHECK-Lib
// CHECK-Lib: remark: loaded module at {{.*}}AppleLogging.swiftmodule
// CHECK-Lib: remark: loaded module {{.*}}AppleLogging.swiftmodule
// RUN: not %FileCheck %s -input-file %t/result-Lib.output -check-prefix CHECK-NOT-Lib
// CHECK-NOT-Lib: remark: loaded module at {{.*}}XLogging.swiftmodule
// CHECK-NOT-Lib: remark: loaded module {{.*}}XLogging.swiftmodule
/// 3a. Client1
/// Create module Client1 that imports Lib and XLogging, WITH module aliasing for XLogging
@@ -37,10 +37,10 @@
// RUN: test -f %t/AppleLogging.swiftmodule
// RUN: not test -f %t/XLogging.swiftmodule
// RUN: %FileCheck %s -input-file %t/result-Client1.output -check-prefix CHECK-CLIENT1
// CHECK-CLIENT1: remark: loaded module at {{.*}}AppleLogging.swiftmodule
// CHECK-CLIENT1: remark: loaded module at {{.*}}Lib.swiftmodule
// CHECK-CLIENT1: remark: loaded module {{.*}}AppleLogging.swiftmodule
// CHECK-CLIENT1: remark: loaded module {{.*}}Lib.swiftmodule
// RUN: not %FileCheck %s -input-file %t/result-Client1.output -check-prefix CHECK-NOT-CLIENT1
// CHECK-NOT-CLIENT1: remark: loaded module at {{.*}}XLogging.swiftmodule
// CHECK-NOT-CLIENT1: remark: loaded module {{.*}}XLogging.swiftmodule
/// 3b. Client2
/// Try creating module Client2 that imports Lib and XLogging, WITHOUT module aliasing
@@ -61,10 +61,10 @@
// RUN: not test -f %t/XLogging.swiftmodule
// RUN: %FileCheck %s -input-file %t/result-Client3.output -check-prefix CHECK-CLIENT3
// CHECK-CLIENT3: remark: loaded module at {{.*}}AppleLogging.swiftmodule
// CHECK-CLIENT3: remark: loaded module at {{.*}}Lib.swiftmodule
// CHECK-CLIENT3: remark: loaded module {{.*}}AppleLogging.swiftmodule
// CHECK-CLIENT3: remark: loaded module {{.*}}Lib.swiftmodule
// RUN: not %FileCheck %s -input-file %t/result-Client3.output -check-prefix CHECK-NOT-CLIENT3
// CHECK-NOT-CLIENT3: remark: loaded module at {{.*}}XLogging.swiftmodule
// CHECK-NOT-CLIENT3: remark: loaded module {{.*}}XLogging.swiftmodule
// BEGIN FileLogging.swift
public struct Logger {

View File

@@ -18,7 +18,7 @@
// RUN: not test -f %t/Cat.swiftmodule
// RUN: %FileCheck %s -input-file %t/load-result-foo.output -check-prefix CHECK-FOO
// CHECK-FOO: remark: loaded module at {{.*}}Bar.swiftmodule
// CHECK-FOO: remark: loaded module {{.*}}Bar.swiftmodule
/// Create a module Zoo that imports Cat with -module-alias Cat=Bar with a source loader
// RUN: %target-swift-frontend -module-name Zoo %t/FileFoo.swift -module-alias Cat=Bar -I %t -emit-module -emit-module-path %t/Zoo.swiftmodule -enable-source-import -Rmodule-loading 2> %t/load-result-zoo.output
@@ -28,7 +28,7 @@
// RUN: not test -f %t/Cat.swiftmodule
// RUN: %FileCheck %s -input-file %t/load-result-zoo.output -check-prefix CHECK-ZOO
// CHECK-ZOO: remark: loaded module at {{.*}}Bar.swiftmodule
// CHECK-ZOO: remark: loaded module {{.*}}Bar.swiftmodule
// BEGIN FileBar.swift

View File

@@ -30,9 +30,9 @@
/// 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-LOAD: remark: loaded module {{.*}}AppleLogging.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-NOT-LOAD1: remark: loaded module {{.*}}XLogging.swiftmodule
/// Check imported modules contain AppleLogging, not XLogging
// RUN: %FileCheck %s -input-file %t/Lib.swiftinterface -check-prefix CHECK-IMPORT

View File

@@ -31,9 +31,9 @@
/// Check AppleLogging.swiftmodule is loaded, and XLogging.swiftmodule is not loaded
// RUN: %FileCheck %s -input-file %t/result-Lib.output -check-prefix CHECK-LOAD1
// CHECK-LOAD1: remark: loaded module at {{.*}}AppleLogging.swiftmodule
// CHECK-LOAD1: remark: loaded module {{.*}}AppleLogging.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-NOT-LOAD1: remark: loaded module {{.*}}XLogging.swiftmodule
/// Check Lib.swiftmodule contains AppleLogging and NOT XLogging as an imported module
/// in the binary
@@ -52,7 +52,7 @@
// RUN: not test -f %t/XLogging.swiftmodule
// RUN: %FileCheck %s -input-file %t/result-Client.output -check-prefix CHECK-LOAD2
// CHECK-LOAD2: remark: loaded module at {{.*}}Lib.swiftmodule
// CHECK-LOAD2: remark: loaded module {{.*}}Lib.swiftmodule
/// Check Client.swiftmodule contains Lib as an imported module in the binary
// RUN: llvm-bcanalyzer --dump %t/Client.swiftmodule | %FileCheck %s -check-prefix=BCANALYZER-IMPORT2