Skip to content

Commit dd85e69

Browse files
committed
Update the tests after removing the -sil-serialize-all option
1 parent 5e67f75 commit dd85e69

File tree

50 files changed

+164
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+164
-107
lines changed

test/IRGen/sil_witness_tables_external_witnesstable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -emit-module %S/Inputs/sil_witness_tables_external_input.swift -o %t/Swift.swiftmodule -parse-stdlib -parse-as-library -module-name Swift -sil-serialize-all -module-link-name swiftCore
2+
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -emit-module %S/Inputs/sil_witness_tables_external_input.swift -o %t/Swift.swiftmodule -parse-stdlib -parse-as-library -module-name Swift -sil-serialize-witness-tables -sil-serialize-vtables -module-link-name swiftCore
33
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -I %t -primary-file %s -emit-ir | %FileCheck %s
44

55
import Swift
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
class A<T> {
1+
public class A<T> {
22
typealias Element = T
3+
@_versioned
4+
@_inlineable
35
func convertFromArrayLiteral(_ elements: Element...) -> A {
46
return A()
57
}
8+
9+
@_versioned
10+
@_inlineable
11+
init() {}
612
}

test/SIL/Serialization/Inputs/def_generic_marker.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public protocol mmCollectionType : mmSequenceType {
1313
> (_ seq: S)
1414
}
1515

16+
@_inlineable
1617
public func test<
1718
EC1 : mmCollectionType,
1819
EC2 : mmCollectionType

test/SIL/Serialization/Inputs/function_param_convention_input.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ struct X {}
33

44
// Make sure that we can deserialize an apply with various parameter calling
55
// conventions.
6-
sil @foo : $@convention(thin) (@in X, @inout X, @in_guaranteed X, @owned X, X, @guaranteed X) -> @out X {
6+
sil [serialized] @foo : $@convention(thin) (@in X, @inout X, @in_guaranteed X, @owned X, X, @guaranteed X) -> @out X {
77
bb0(%0 : $*X, %1 : $*X, %2 : $*X, %3 : $*X, %4 : $X, %5 : $X, %6 : $X):
88
%9999 = tuple()
99
return %9999 : $()

test/SIL/Serialization/Inputs/nontransparent.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,27 @@ public enum Optional<T> {
66
}
77

88
public struct B {
9+
@_inlineable
910
public func amIConfused() {}
11+
@_inlineable
12+
public init() {}
1013
}
1114

1215
public struct A {
1316
public var b : B
1417

18+
@_inlineable
1519
public init() {
1620
b = B()
1721
}
1822

23+
@_inlineable
1924
public func isBConfused() {
2025
b.amIConfused()
2126
}
2227
}
2328

29+
@_inlineable
2430
public func doSomething() -> A {
2531
var a = A()
2632
return a

test/SIL/Serialization/Inputs/shared_function_serialization_input.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11

22
public struct X {
3+
@_inlineable
34
public init() { }
45
}
56

7+
@_inlineable
68
@inline(never)
79
public func the_thing<T>(t t : T) { }
810

11+
@_inlineable
912
@inline(never)
1013
public func the_thing_it_does(x x : X) {
1114
the_thing(t: x)

test/SIL/Serialization/Inputs/specializer_input.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
public typealias Int = Builtin.Int32
33

44
public struct Container<V> {
5+
@_inlineable
56
@inline(never)
67
public func doSomething() {}
8+
@_inlineable
79
@inline(never)
810
public init() {}
911
}

test/SIL/Serialization/Inputs/vtable_deserialization_input.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ public protocol P {
77
func unknown() -> ()
88

99
public class Y : P {
10+
@_inlineable
1011
public func doAnotherThing() {
1112
unknown()
1213
}
1314

15+
@_inlineable
1416
public func doSomething() {
1517
doAnotherThing()
1618
}
19+
@_inlineable
1720
public init() {}
1821
}

test/SIL/Serialization/deserialize_generic.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -emit-module -sil-serialize-all -o %t %S/Inputs/def_generic.swift
2+
// RUN: %target-swift-frontend -emit-module -sil-serialize-witness-tables -sil-serialize-vtables -o %t %S/Inputs/def_generic.swift
33
// RUN: %target-sil-opt -assume-parsing-unqualified-ownership-sil -linker -I %t %s | %FileCheck %s
44

55
// Make sure that SILFunctionType with GenericSignature can match up with

test/SIL/Serialization/deserialize_generic_marker.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -emit-module -sil-serialize-all -o %t %S/Inputs/def_generic_marker.swift
2+
// RUN: %target-swift-frontend -emit-module -sil-serialize-witness-tables -sil-serialize-vtables -o %t %S/Inputs/def_generic_marker.swift
33
// RUN: %target-sil-opt -assume-parsing-unqualified-ownership-sil -linker -I %t %s | %FileCheck %s
44

55
// Make sure that SILFunctionType with GenericSignature can match up with

test/SIL/Serialization/function_param_convention.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -parse-sil -sil-inline-threshold 0 %S/Inputs/function_param_convention_input.sil -o %t/FunctionInput.swiftmodule -emit-module -parse-as-library -parse-stdlib -module-name FunctionInput -sil-serialize-all -O
2+
// RUN: %target-swift-frontend -parse-sil -sil-inline-threshold 0 %S/Inputs/function_param_convention_input.sil -o %t/FunctionInput.swiftmodule -emit-module -parse-as-library -parse-stdlib -module-name FunctionInput -sil-serialize-witness-tables -sil-serialize-vtables -O
33
// RUN: %target-sil-opt -assume-parsing-unqualified-ownership-sil -I %t -linker %s -o - | %FileCheck %s
44

55
import Swift
66
import FunctionInput
77

88
// Make sure we can deserialize a SIL function with these various attributes.
9-
// CHECK: sil public_external @foo : $@convention(thin) (@in X, @inout X, @in_guaranteed X, @owned X, X, @guaranteed X) -> @out X {
9+
// CHECK: sil public_external [serialized] @foo : $@convention(thin) (@in X, @inout X, @in_guaranteed X, @owned X, X, @guaranteed X) -> @out X {
1010

1111
sil @foo : $@convention(thin) (@in X, @inout X, @in_guaranteed X, @owned X, X, @guaranteed X) -> @out X
1212

test/SIL/Serialization/init_existential_inst_deserializes_witness_tables.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -sil-inline-threshold 0 %S/Inputs/init_existential_inst_deserializes_witness_tables_input.swift -o %t/Swift.swiftmodule -emit-module -parse-as-library -parse-stdlib -module-link-name swiftCore -module-name Swift -sil-serialize-all -O
2+
// RUN: %target-swift-frontend -sil-inline-threshold 0 %S/Inputs/init_existential_inst_deserializes_witness_tables_input.swift -o %t/Swift.swiftmodule -emit-module -parse-as-library -parse-stdlib -module-link-name swiftCore -module-name Swift -sil-serialize-witness-tables -O
33
// RUN: %target-swift-frontend -I %t -O %s -emit-sil -o - | %FileCheck %s
44

55
// CHECK: sil_witness_table public_external [serialized] X: P module Swift {

test/SIL/Serialization/perf_inline_without_inline_all.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -emit-module %S/Inputs/nontransparent.swift -O -sil-serialize-all -parse-stdlib -parse-as-library -emit-module -o %t/Swift.swiftmodule -module-name=Swift -module-link-name swiftCore
2+
// RUN: %target-swift-frontend -emit-module %S/Inputs/nontransparent.swift -O -sil-serialize-witness-tables -sil-serialize-vtables -parse-stdlib -parse-as-library -emit-module -o %t/Swift.swiftmodule -module-name=Swift -module-link-name swiftCore
33
// RUN: %target-swift-frontend %s -O -I %t -emit-sil -o - | %FileCheck %s
44

55
import Swift

test/SIL/Serialization/projection_lowered_type_parse.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -emit-module %s -module-name Swift -sil-serialize-all -module-link-name swiftCore -parse-as-library -parse-sil -parse-stdlib -o - | %target-sil-opt -assume-parsing-unqualified-ownership-sil -module-name=Swift
1+
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -emit-module %s -module-name Swift -sil-serialize-witness-tables -sil-serialize-vtables -module-link-name swiftCore -parse-as-library -parse-sil -parse-stdlib -o - | %target-sil-opt -assume-parsing-unqualified-ownership-sil -module-name=Swift
22

33
struct A {
44
var f : () -> ()

test/SIL/Serialization/public_external.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend %s -Xllvm -sil-disable-pass="External Definition To Declaration" -parse-sil -emit-module -module-name Swift -module-link-name swiftCore -parse-stdlib -parse-as-library -sil-serialize-all -o - | %target-sil-opt -assume-parsing-unqualified-ownership-sil -module-name Swift -emit-sorted-sil | %FileCheck %s
1+
// RUN: %target-swift-frontend %s -Xllvm -sil-disable-pass="External Definition To Declaration" -parse-sil -emit-module -module-name Swift -module-link-name swiftCore -parse-stdlib -parse-as-library -sil-serialize-witness-tables -sil-serialize-vtables -o - | %target-sil-opt -assume-parsing-unqualified-ownership-sil -module-name Swift -emit-sorted-sil | %FileCheck %s
22

33
sil_stage raw
44
import Builtin
@@ -110,7 +110,7 @@ sil public_external [noinline] @public_external_fn : $@convention(thin) () -> ()
110110

111111
// The body of this fragile function has to be emitted.
112112
// CHECK-LABEL: sil{{.*}}@use_external_functions : $@convention(thin) () -> () {
113-
sil @use_external_functions: $@convention(thin) () -> () {
113+
sil [serialized] @use_external_functions: $@convention(thin) () -> () {
114114
%0 = function_ref @public_external_fn : $@convention(thin) () -> ()
115115
%1 = apply %0 () : $@convention(thin) () -> ()
116116

test/SIL/Serialization/shared_function_serialization.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend %S/Inputs/shared_function_serialization_input.swift -o %t/Swift.swiftmodule -emit-module -parse-as-library -parse-stdlib -module-link-name swiftCore -module-name Swift -sil-serialize-all -O
2+
// RUN: %target-swift-frontend %S/Inputs/shared_function_serialization_input.swift -o %t/Swift.swiftmodule -emit-module -parse-as-library -parse-stdlib -module-link-name swiftCore -module-name Swift -sil-serialize-witness-tables -sil-serialize-vtables -O
33
// RUN: %target-sil-opt -assume-parsing-unqualified-ownership-sil -enable-sil-verify-all -I %t -linker -inline %s -o - | %FileCheck %s
44

55
// CHECK: sil private @top_level_code

test/SIL/Serialization/specializer_can_deserialize.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -emit-module %S/Inputs/specializer_input.swift -O -sil-serialize-all -parse-stdlib -parse-as-library -emit-module -o %t/Swift.swiftmodule -module-name=Swift -module-link-name swiftCore
2+
// RUN: %target-swift-frontend -emit-module %S/Inputs/specializer_input.swift -O -sil-serialize-witness-tables -sil-serialize-vtables -parse-stdlib -parse-as-library -emit-module -o %t/Swift.swiftmodule -module-name=Swift -module-link-name swiftCore
33
// RUN: %target-swift-frontend %s -O -I %t -emit-sil -o - | %FileCheck %s
44

55
import Swift

test/SIL/Serialization/visibility.sil

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend %s -Xllvm -sil-disable-pass="External Definition To Declaration" -parse-sil -sil-serialize-all -emit-module -o - -module-name Swift -module-link-name swiftCore -parse-as-library -parse-stdlib | %target-sil-opt -assume-parsing-unqualified-ownership-sil -enable-sil-verify-all=false -module-name Swift > %t.sil
1+
// RUN: %target-swift-frontend %s -Xllvm -sil-disable-pass="External Definition To Declaration" -parse-sil -sil-serialize-witness-tables -emit-module -o - -module-name Swift -module-link-name swiftCore -parse-as-library -parse-stdlib | %target-sil-opt -assume-parsing-unqualified-ownership-sil -enable-sil-verify-all=false -module-name Swift > %t.sil
22
// RUN: %FileCheck %s < %t.sil
33
// RUN: %FileCheck -check-prefix=NEG-CHECK %s < %t.sil
44

@@ -212,7 +212,7 @@ sil hidden_external [serialized] @hidden_external_function_test : $@convention(t
212212
return %8 : $()
213213
}
214214

215-
sil @hidden_external_function_test_caller : $@convention(thin) () -> () {
215+
sil [serialized] @hidden_external_function_test_caller : $@convention(thin) () -> () {
216216
%0 = function_ref @hidden_external_function_test : $@convention(thin) () -> ()
217217
%1 = apply %0() : $@convention(thin) () -> ()
218218
%2 = tuple()
@@ -240,7 +240,7 @@ sil public_external [serialized] @public_external_function_test : $@convention(t
240240
return %8 : $()
241241
}
242242

243-
sil @public_external_function_test_caller : $@convention(thin) () -> () {
243+
sil [serialized] @public_external_function_test_caller : $@convention(thin) () -> () {
244244
%0 = function_ref @public_external_function_test : $@convention(thin) () -> ()
245245
%1 = apply %0() : $@convention(thin) () -> ()
246246
%2 = tuple()
@@ -268,7 +268,7 @@ sil shared_external [serialized] @shared_external_function_test : $@convention(t
268268
return %8 : $()
269269
}
270270

271-
sil @shared_external_function_test_caller : $@convention(thin) () -> () {
271+
sil [serialized] @shared_external_function_test_caller : $@convention(thin) () -> () {
272272
%0 = function_ref @shared_external_function_test : $@convention(thin) () -> ()
273273
%1 = apply %0() : $@convention(thin) () -> ()
274274
%2 = tuple()

test/SIL/Serialization/vtable_deserialization.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend %S/Inputs/vtable_deserialization_input.swift -o %t/Swift.swiftmodule -emit-module -parse-as-library -parse-stdlib -module-link-name swiftCore -module-name Swift -sil-serialize-all
2+
// RUN: %target-swift-frontend %S/Inputs/vtable_deserialization_input.swift -o %t/Swift.swiftmodule -emit-module -parse-as-library -parse-stdlib -module-link-name swiftCore -module-name Swift -sil-serialize-witness-tables -sil-serialize-vtables
33
// RUN: %target-swift-frontend %s -emit-sil -O -I %t -o - | %FileCheck %s
44

55
import Swift
66

7+
@_versioned
8+
@_inlineable
79
func WhatShouldIDoImBored<T : P>(_ t : T) {
810
t.doSomething()
911
}

test/SIL/Serialization/witness_tables.sil

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -parse-as-library -sil-serialize-all -module-name witness_tables -emit-module -o - %s | %target-sil-opt -assume-parsing-unqualified-ownership-sil -module-name witness_tables | %FileCheck %s
1+
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -parse-as-library -sil-serialize-witness-tables -module-name witness_tables -emit-module -o - %s | %target-sil-opt -assume-parsing-unqualified-ownership-sil -module-name witness_tables | %FileCheck %s
22

33
protocol AssocReqt {
44
func requiredMethod()
@@ -8,25 +8,25 @@ struct ConformingAssoc : AssocReqt {
88
func requiredMethod()
99
}
1010

11-
sil @_TFV14witness_tables15ConformingAssoc14requiredMethodfS0_FT_T_ : $@convention(method) (ConformingAssoc) -> () {
11+
sil [serialized] @_TFV14witness_tables15ConformingAssoc14requiredMethodfS0_FT_T_ : $@convention(method) (ConformingAssoc) -> () {
1212
bb0(%0 : $ConformingAssoc):
1313
debug_value %0 : $ConformingAssoc
1414
%2 = tuple ()
1515
return %2 : $()
1616
}
1717

18-
sil @_TTWV14witness_tables15ConformingAssocS_9AssocReqtS_FS1_14requiredMethodU_fRQPS1_FT_T_ : $@convention(witness_method) (@inout ConformingAssoc) -> () {
18+
sil [serialized] @_TTWV14witness_tables15ConformingAssocS_9AssocReqtS_FS1_14requiredMethodU_fRQPS1_FT_T_ : $@convention(witness_method) (@inout ConformingAssoc) -> () {
1919
bb0(%0 : $*ConformingAssoc):
2020
%1 = load %0 : $*ConformingAssoc
2121
%2 = function_ref @_TFV14witness_tables15ConformingAssoc14requiredMethodfS0_FT_T_ : $@convention(method) (ConformingAssoc) -> ()
2222
%3 = apply %2(%1) : $@convention(method) (ConformingAssoc) -> ()
2323
return %3 : $()
2424
}
2525

26-
// CHECK-LABEL: sil_witness_table ConformingAssoc: AssocReqt module witness_tables {
26+
// CHECK-LABEL: sil_witness_table [serialized] ConformingAssoc: AssocReqt module witness_tables {
2727
// CHECK: #AssocReqt.requiredMethod!1: {{.*}} : @_TTWV14witness_tables15ConformingAssocS_9AssocReqtS_FS1_14requiredMethodU_fRQPS1_FT_T_
2828
// CHECK: }
29-
sil_witness_table ConformingAssoc: AssocReqt module witness_tables {
29+
sil_witness_table [serialized] ConformingAssoc: AssocReqt module witness_tables {
3030
method #AssocReqt.requiredMethod!1: @_TTWV14witness_tables15ConformingAssocS_9AssocReqtS_FS1_14requiredMethodU_fRQPS1_FT_T_
3131
}
3232

@@ -57,18 +57,18 @@ struct InheritedConformance2 : InheritedProtocol1 {
5757
}
5858

5959

60-
// CHECK-LABEL: sil_witness_table shared InheritedConformance: InheritedProtocol1 module
60+
// CHECK-LABEL: sil_witness_table shared [serialized] InheritedConformance: InheritedProtocol1 module
6161
// CHECK: base_protocol AnyProtocol: InheritedConformance: AnyProtocol module
6262
// CHECK: }
63-
sil_witness_table shared InheritedConformance: InheritedProtocol1 module witness_tables {
63+
sil_witness_table shared [serialized] InheritedConformance: InheritedProtocol1 module witness_tables {
6464
base_protocol AnyProtocol: InheritedConformance: AnyProtocol module witness_tables
6565
}
6666

67-
// CHECK-LABEL: sil_witness_table shared InheritedConformance: AnyProtocol module
67+
// CHECK-LABEL: sil_witness_table shared [serialized] InheritedConformance: AnyProtocol module
6868
// CHECK: associated_type AssocType: SomeAssoc
6969
// CHECK: associated_type_protocol (AssocWithReqt: AssocReqt): ConformingAssoc: AssocReqt module
7070
// CHECK: }
71-
sil_witness_table shared InheritedConformance: AnyProtocol module witness_tables {
71+
sil_witness_table shared [serialized] InheritedConformance: AnyProtocol module witness_tables {
7272
associated_type AssocType: SomeAssoc
7373
associated_type_protocol (AssocWithReqt: AssocReqt): ConformingAssoc: AssocReqt module witness_tables
7474
}
@@ -89,10 +89,10 @@ class DeadMethodClass : Proto {
8989
func abc()
9090
}
9191

92-
// CHECK-LABEL: sil_witness_table DeadMethodClass: Proto module witness_tables
92+
// CHECK-LABEL: sil_witness_table [serialized] DeadMethodClass: Proto module witness_tables
9393
// CHECK: method #Proto.abc!1: {{.*}} : nil
9494
// CHECK: }
95-
sil_witness_table DeadMethodClass: Proto module witness_tables {
95+
sil_witness_table [serialized] DeadMethodClass: Proto module witness_tables {
9696
method #Proto.abc!1: nil
9797
}
9898

test/SILGen/Inputs/ModuleA.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
@_versioned
2+
internal var gg = nonTrivialInit()
13

2-
private var gg = nonTrivialInit()
3-
4+
@_inlineable
45
public func get_gg_a() -> Int {
56
return gg
67
}
78

9+
@_inlineable
10+
@_versioned
811
@inline(never)
9-
private func nonTrivialInit() -> Int {
12+
internal func nonTrivialInit() -> Int {
1013
return 27
1114
}

test/SILGen/Inputs/ModuleB.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
@_versioned
2+
internal var gg = nonTrivialInit()
13

2-
3-
private var gg = nonTrivialInit()
4-
4+
@_inlineable
55
public func get_gg_b() -> Int {
66
return gg
77
}
88

9+
@_versioned
10+
@_inlineable
911
@inline(never)
10-
private func nonTrivialInit() -> Int {
12+
internal func nonTrivialInit() -> Int {
1113
return 28
1214
}

test/SILGen/fragile_globals.swift

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,30 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -emit-module -parse-as-library -sil-serialize-all -o %t %S/Inputs/ModuleA.swift
3-
// RUN: %target-swift-frontend -emit-module -parse-as-library -sil-serialize-all -o %t %S/Inputs/ModuleB.swift
2+
// RUN: %target-swift-frontend -emit-module -parse-as-library -sil-serialize-witness-tables -o %t %S/Inputs/ModuleA.swift
3+
// RUN: %target-swift-frontend -emit-module -parse-as-library -sil-serialize-witness-tables -o %t %S/Inputs/ModuleB.swift
44
// RUN: %target-swift-frontend -parse-as-library -I%t %s -Xllvm -sil-disable-pass="SIL Global Optimization" -O -emit-sil | %FileCheck %s
55

66
import ModuleA
77
import ModuleB
88

99
var mygg = 29
1010

11-
// Check if we have three tokens: 2 from the imported modules, one from mygg.
11+
// Check if we have one token: from mygg.
12+
// Initializers from other modules are never fragile.
1213

13-
// CHECK: sil_global private{{.*}} @globalinit_[[T1:.*]]_token0
14-
// CHECK: sil_global private{{.*}} @globalinit_[[T2:.*]]_token0
1514
// CHECK: sil_global private{{.*}} @globalinit_[[T3:.*]]_token0
1615

16+
//@_inlineable
1717
public func sum() -> Int {
1818
return mygg + get_gg_a() + get_gg_b()
1919
}
2020

2121
// Check if all the addressors are inlined.
2222

23-
// CHECK-LABEL: sil @_T015fragile_globals3sumSiyF
24-
// CHECK-DAG: global_addr @_T015fragile_globals4myggSiv
25-
// CHECK-DAG: global_addr @_T07ModuleA2gg33_{{.*}}
26-
// CHECK-DAG: global_addr @_T07ModuleA2gg33_{{.*}}
27-
// CHECK-DAG: global_addr @globalinit_[[T1]]_token0
28-
// CHECK-DAG: global_addr @globalinit_[[T2]]_token0
29-
// CHECK-DAG: global_addr @globalinit_[[T3]]_token0
23+
// CHECK-LABEL: sil {{.*}}@_T015fragile_globals3sumSiyF
24+
// CHECK-DAG: global_addr @globalinit_[[T1:.*]]_token0
3025
// CHECK-DAG: function_ref @globalinit_[[T1]]_func0
31-
// CHECK-DAG: function_ref @globalinit_[[T2]]_func0
32-
// CHECK-DAG: function_ref @globalinit_[[T3]]_func0
26+
// CHECK-DAG: global_addr @_T015fragile_globals4myggSivp
27+
// CHECK-DAG: function_ref @_T07ModuleA2ggSivau
28+
// CHECK-DAG: function_ref @_T07ModuleB2ggSivau
3329
// CHECK: return
3430

0 commit comments

Comments
 (0)