From ed877ff0f2f6f5102ed38c09d7f02c5c191efc0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20Laferri=C3=A8re?= Date: Thu, 17 Nov 2022 16:58:49 -0800 Subject: [PATCH] [Test] Make more permissive checks against the format of -Rmodule-loading --- test/Frontend/module-alias-diags.swift | 2 +- test/Frontend/module-alias-explicit-build.swift | 2 +- test/Frontend/module-alias-for-client.swift | 12 ++++++------ .../module-alias-for-lib-and-client.swift | 16 ++++++++-------- test/Frontend/module-alias-load.swift | 4 ++-- .../module-alias-serialize-swiftinterface.swift | 4 ++-- .../module-alias-serialize-swiftmodule.swift | 6 +++--- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/test/Frontend/module-alias-diags.swift b/test/Frontend/module-alias-diags.swift index 8608ef0c537..91944c5fba9 100644 --- a/test/Frontend/module-alias-diags.swift +++ b/test/Frontend/module-alias-diags.swift @@ -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 diff --git a/test/Frontend/module-alias-explicit-build.swift b/test/Frontend/module-alias-explicit-build.swift index bb4efd48ffd..fcfca550f1e 100644 --- a/test/Frontend/module-alias-explicit-build.swift +++ b/test/Frontend/module-alias-explicit-build.swift @@ -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 diff --git a/test/Frontend/module-alias-for-client.swift b/test/Frontend/module-alias-for-client.swift index 778da5a67ea..5a19757bdb6 100644 --- a/test/Frontend/module-alias-for-client.swift +++ b/test/Frontend/module-alias-for-client.swift @@ -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 diff --git a/test/Frontend/module-alias-for-lib-and-client.swift b/test/Frontend/module-alias-for-lib-and-client.swift index 3a53ca46d45..dd917fb60a9 100644 --- a/test/Frontend/module-alias-for-lib-and-client.swift +++ b/test/Frontend/module-alias-for-lib-and-client.swift @@ -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 { diff --git a/test/Frontend/module-alias-load.swift b/test/Frontend/module-alias-load.swift index 59ab743ebb8..475d3a9bb2e 100644 --- a/test/Frontend/module-alias-load.swift +++ b/test/Frontend/module-alias-load.swift @@ -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 diff --git a/test/Frontend/module-alias-serialize-swiftinterface.swift b/test/Frontend/module-alias-serialize-swiftinterface.swift index d19da5ddf80..5a5324cf360 100644 --- a/test/Frontend/module-alias-serialize-swiftinterface.swift +++ b/test/Frontend/module-alias-serialize-swiftinterface.swift @@ -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 diff --git a/test/Frontend/module-alias-serialize-swiftmodule.swift b/test/Frontend/module-alias-serialize-swiftmodule.swift index 4b0f666e0fb..5188ce9a2ed 100644 --- a/test/Frontend/module-alias-serialize-swiftmodule.swift +++ b/test/Frontend/module-alias-serialize-swiftmodule.swift @@ -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