Skip to content

Commit 15c1b4e

Browse files
adrian-prantlxedin
authored andcommitted
Compile libraries in testcases with -parse-as-library (NFC)
This is in preparation to a change in serialization of global variables where this detail will matter.
1 parent 4bd1ffc commit 15c1b4e

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

test/DebugInfo/inlinescopes.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: %FileCheck %s -check-prefix=TRANSPARENT-CHECK < %t.ll
77

88
// CHECK: define{{( dllexport)?}}{{( protected)?( signext)?}} i32 @main{{.*}}
9-
// CHECK: call swiftcc i64 @"$s4main8noinlineys5Int64VADF"(i64 %4), !dbg ![[CALL:.*]]
9+
// CHECK: call swiftcc i64 @"$s4main8noinlineys5Int64VADF"(i64 %{{.*}}), !dbg ![[CALL:.*]]
1010
// CHECK-DAG: ![[TOPLEVEL:.*]] = !DIFile(filename: "{{.*}}inlinescopes.swift"
1111

1212
import FooBar

test/SILGen/expressions.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
// RUN: %empty-directory(%t)
3-
// RUN: echo "public var x = Int()" | %target-swift-frontend -module-name FooBar -emit-module -o %t -
3+
// RUN: echo "public var x = Int()" | %target-swift-frontend -parse-as-library -module-name FooBar -emit-module -o %t -
44
// RUN: %target-swift-emit-silgen -parse-stdlib -module-name expressions %s -I%t -disable-access-control | %FileCheck %s
55

66
import Swift

test/SILGen/global_init_attribute.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -Xllvm -sil-full-demangle -emit-module -o %t %S/Inputs/def_global.swift
2+
// RUN: %target-swift-frontend -Xllvm -sil-full-demangle -parse-as-library -emit-module -o %t %S/Inputs/def_global.swift
33
// RUN: %target-swift-emit-silgen -Xllvm -sil-full-demangle -parse-as-library -I %t %s | %FileCheck %s
44
//
55
// Test that SILGen uses the "global_init" attribute for all global

test/SILGen/global_resilience.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -emit-module -enable-library-evolution -emit-module-path=%t/resilient_global.swiftmodule -module-name=resilient_global %S/../Inputs/resilient_global.swift
2+
// RUN: %target-swift-frontend -emit-module -parse-as-library -enable-library-evolution -emit-module-path=%t/resilient_global.swiftmodule -module-name=resilient_global %S/../Inputs/resilient_global.swift
33
// RUN: %target-swift-emit-silgen -I %t -enable-library-evolution -parse-as-library %s | %FileCheck %s
44
// RUN: %target-swift-emit-sil -I %t -O -enable-library-evolution -parse-as-library %s | %FileCheck --check-prefix=CHECK-OPT %s
55

test/Serialization/Recovery/typedefs.swift

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// RUN: %empty-directory(%t)
2+
3+
// Cannot use -parse-as-library here because that would compile also the
4+
// #if VERIFY path, which contains top-level code.
25
// RUN: %target-swift-frontend -emit-sil -o - -emit-module-path %t/Lib.swiftmodule -module-name Lib -I %S/Inputs/custom-modules -disable-objc-attr-requires-foundation-module -enable-objc-interop %s | %FileCheck -check-prefix CHECK-VTABLE %s
36

47
// RUN: %target-swift-ide-test -source-filename=x -print-module -module-to-print Lib -I %t -I %S/Inputs/custom-modules | %FileCheck %s
@@ -23,9 +26,9 @@ import Lib
2326
// CHECK-SIL-LABEL: sil hidden [ossa] @$s8typedefs11testSymbolsyyF
2427
func testSymbols() {
2528
// Check that the symbols are not using 'Bool'.
26-
// CHECK-SIL: function_ref @$s3Lib1xs5Int32Vvau
29+
// CHECK-SIL: global_addr @$s3Lib9usesAssocs5Int32VSgvp
2730
_ = Lib.x
28-
// CHECK-SIL: function_ref @$s3Lib9usesAssocs5Int32VSgvau
31+
// CHECK-SIL: global_addr @$s3Lib1xs5Int32Vvp
2932
_ = Lib.usesAssoc
3033
} // CHECK-SIL: end sil function '$s8typedefs11testSymbolsyyF'
3134

0 commit comments

Comments
 (0)