Skip to content

[test] Add missing colons for FileCheck #71897

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/DebugInfo/debug_info_expression.sil
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ bb0:
// CHECK: %[[FIELD_X:.*]] = getelementptr {{.*}} %[[MY_STRUCT]]
// CHECK-SIL: debug_value %{{[0-9]+}} : $*Builtin.Int64
// CHECK-SIL-SAME: (name "my_struct", loc "file.swift":8:9, scope {{[0-9]+}})
// CHECK-SIL-SAME type $MyStruct, expr op_deref:op_fragment:#MyStruct.x
// CHECK-SIL-SAME: type $MyStruct, expr op_deref:op_fragment:#MyStruct.x
debug_value %3 : $*Builtin.Int64, var, (name "my_struct", loc "file.swift":8:9, scope 1), type $MyStruct, expr op_deref:op_fragment:#MyStruct.x, loc "file.swift":9:17, scope 1

%4 = alloc_stack $SmallStruct, var, name "small_struct", loc "file.swift":10:11, scope 1
Expand Down
4 changes: 2 additions & 2 deletions test/DebugInfo/implicit-scope.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public func main() {
// Test that the first instruction on the next line is in the scope of "buf"
// CHECK: store {{.*}}, !dbg ![[LOC0:[0-9]+]]
// CHECK: call {{.*builtinStringLiteral.*}}, !dbg ![[LOC1:[0-9]+]]
// CHECK ![[LOC0]] = {{.*}}line: 0
// CHECK ![[LOC1]] = {{.*}}line: [[@LINE+1]]
// CHECK: ![[LOC0]] = {{.*}}line: 0
// CHECK: ![[LOC1]] = {{.*}}line: [[@LINE+1]]
print("break here ...")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// CHECK-SAME: i32 {{[0-9]+}},
// CHECK-SAME: $s4main5ValueOwug
// CHECK-SAME: $s4main5ValueOwup
// CHECK-SAME ptr {{[^@]*}}@"$s4main5ValueOwui{{[^}]+}}
// CHECK-SAME: ptr {{[^@]*}}@"$s4main5ValueOwui{{[^}]+}}
// CHECK-SAME: }, align [[ALIGNMENT]]
// CHECK: @"$s4main5ValueOyS2iGMf" = linkonce_odr hidden constant <{
// CHECK-SAME: ptr,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// CHECK-SAME: i32 {{[0-9]+}},
// CHECK-SAME: $s4main5ValueOwug
// CHECK-SAME: $s4main5ValueOwup
// CHECK-SAME ptr {{[^@]*}}@"$s4main5ValueOwui{{[^,]*}}
// CHECK-SAME: ptr {{[^@]*}}@"$s4main5ValueOwui
// CHECK-SAME: }, align [[ALIGNMENT]]
// CHECK: @"$s4main5ValueOyS4iGMf" = linkonce_odr hidden constant <{
// CHECK-SAME: ptr,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// CHECK-SAME: i32 {{[0-9]+}},
// CHECK-SAME: $s4main5ValueOwug
// CHECK-SAME: $s4main5ValueOwup
// CHECK-SAME ptr {{[^@]*}}@"$s4main5ValueOwui{{[^,]*}}
// CHECK-SAME: ptr {{[^@]*}}@"$s4main5ValueOwui
// CHECK-SAME: }, align [[ALIGNMENT]]
// CHECK: @"$s4main5ValueOyS5iGMf" = linkonce_odr hidden constant <{
// CHECK-SAME: ptr,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
// CHECK-SAME: $s4main5ValueVwet
// CHECK-SAME: $s4main5ValueVwst
// CHECK-SAME: [[INT]] {{[0-9]+}},
// CHECK-SAMEL [[INT]] {{[0-9]+}},
// CHECK-SAME: [[INT]] {{[0-9]+}},
// CHECK-SAME: i32 {{[0-9]+}},
// CHECK-SAME: i32 {{[0-9]+}}
// CHECK-SAME: },
Expand Down
2 changes: 1 addition & 1 deletion test/IRGen/relative_protocol_witness_table.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func instantiate_conditional_conformance_2nd<T>(_ t : T) where T: Sub, T.S == T
// CHECK-SAME: i64 ptrtoint (ptr @"$s1A7BStructVAA9InheritedAAWP" to i64)) to i32),
// CHECK-SAME: i32 trunc (i64 sub (i64 ptrtoint (ptr @"$s1A7BStructVAA8FuncOnlyAAWP" to i64),
// CHECK-SAME: i64 ptrtoint (ptr getelementptr inbounds ([3 x i32], ptr @"$s1A7BStructVAA9InheritedAAWP", i32 0, i32 1) to i64)) to i32),
// CHECK-SAME i32 trunc (i64 sub (i64 ptrtoint (ptr @"$s1A7BStructVAA9InheritedA2aDP1cyyFTW" to i64),
// CHECK-SAME: i32 trunc (i64 sub (i64 ptrtoint (ptr @"$s1A7BStructVAA9InheritedA2aDP1cyyFTW" to i64),
// CHECK-SAME: i64 ptrtoint (ptr getelementptr inbounds ([3 x i32], ptr @"$s1A7BStructVAA9InheritedAAWP", i32 0, i32 2) to i64)) to i32)
// CHECK-SAME: ], align 8

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ extension Array {
}
}

// CHECK class SWIFT_SYMBOL("s:7Structs14TypeAfterArrayV") TypeAfterArray;
// CHECK: class SWIFT_SYMBOL("s:7Structs14TypeAfterArrayV") TypeAfterArray;
// CHECK: class SWIFT_SYMBOL("s:7Structs5ArrayV") Array final {
// CHECK: swift::Int getX() const SWIFT_SYMBOL("s:7Structs5ArrayV1xSivp");
// CHECK-NEXT: SWIFT_INLINE_THUNK void setX(swift::Int value) SWIFT_SYMBOL("s:7Structs5ArrayV1xSivp");
Expand Down
4 changes: 2 additions & 2 deletions test/SILGen/foreach_async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ struct AsyncLazySequence<S: Sequence>: AsyncSequence {

// CHECK: [[NONE_BB]]:
// CHECK: funcEnd
// CHECK return
// CHECK: return
// CHECK: } // end sil function '$s13foreach_async13trivialStructyyAA17AsyncLazySequenceVySaySiGGYaF'
func trivialStruct(_ xx: AsyncLazySequence<[Int]>) async {
for await x in xx {
Expand Down Expand Up @@ -136,7 +136,7 @@ func trivialStruct(_ xx: AsyncLazySequence<[Int]>) async {

// CHECK: [[NONE_BB]]:
// CHECK: funcEnd
// CHECK return
// CHECK: return
// CHECK: } // end sil function '$s13foreach_async21trivialStructContinueyyAA17AsyncLazySequenceVySaySiGGYaF'

func trivialStructContinue(_ xx: AsyncLazySequence<[Int]>) async {
Expand Down
8 changes: 4 additions & 4 deletions test/SILGen/generic_signatures.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,22 @@ protocol Whereable {
associatedtype Bssoc: Whereable
}
extension Whereable {
// CHECK-LABEL sil hidden [ossa] @$s18generic_signatures9WhereablePAAE19staticExtensionFunc3arg7ElementSTQz8IteratorSTQz_tSTRzrlFZ : $@convention(method) <Self where Self : Sequence, Self : Whereable> (@in_guaranteed Self.Iterator, @thick Self.Type) -> @out Self.Element
// CHECK-LABEL: sil hidden [ossa] @$s18generic_signatures9WhereablePAAE19staticExtensionFunc3arg7ElementSTQz8IteratorSTQz_tSTRzrlFZ : $@convention(method) <Self where Self : Sequence, Self : Whereable> (@in_guaranteed Self.Iterator, @thick Self.Type) -> @out Self.Element
static func staticExtensionFunc(arg: Self.Iterator) -> Self.Element
where Self: Sequence {
fatalError()
}

// CHECK-LABEL sil hidden [ossa] @$s18generic_signatures9WhereablePAAE13extensionFuncyy5BssocQz5AssocRtzrlF : $@convention(method) <Self where Self : Whereable, Self.Assoc == Self.Bssoc> (@in_guaranteed Self) -> ()
// CHECK-LABEL: sil hidden [ossa] @$s18generic_signatures9WhereablePAAE13extensionFuncyy5BssocQz5AssocRtzrlF : $@convention(method) <Self where Self : Whereable, Self.Assoc == Self.Bssoc> (@in_guaranteed Self) -> ()
func extensionFunc() where Assoc == Bssoc { }

// CHECK-LABEL sil hidden [ossa] @$s18generic_signatures9WhereablePAAE5AssocQzSgycAabERQAD_5BssocQZAGRtzrluig : $@convention(method) <Self where Self : Whereable, Self.Assoc : Whereable, Self.Bssoc == Self.Assoc.Bssoc> (@in_guaranteed Self) -> @out Optional<Self.Assoc>
// CHECK-LABEL: sil hidden [ossa] @$s18generic_signatures9WhereablePAAE5AssocQzycAabERQAD_5BssocQZAFRtzrluig : $@convention(method) <Self where Self : Whereable, Self.Assoc : Whereable, Self.Bssoc == Self.Assoc.Bssoc> (@in_guaranteed Self) -> @out Self.Assoc
subscript() -> Assoc
where Assoc: Whereable, Bssoc == Assoc.Bssoc {
fatalError()
}

// CHECK-LABEL sil hidden [ossa] @$s18generic_signatures9WhereablePAAE5AssocQzSgycAabERQ5Bssoc_ADQZAERSrluig : $@convention(method) <Self where Self : Whereable, Self.Assoc : Whereable, Self.Assoc == Self.Bssoc.Assoc> (@in_guaranteed Self) -> @out Optional<Self.Assoc>
// CHECK-LABEL: sil hidden [ossa] @$s18generic_signatures9WhereablePAAE5AssocQzycAabERQ5Bssoc_ADQZAERSrluig : $@convention(method) <Self where Self : Whereable, Self.Assoc : Whereable, Self.Assoc == Self.Bssoc.Assoc> (@in_guaranteed Self) -> @out Self.Assoc
subscript() -> Assoc
where Assoc: Whereable, Assoc == Bssoc.Assoc {
fatalError()
Expand Down
12 changes: 6 additions & 6 deletions test/SILOptimizer/OSLogMandatoryOptTest.sil
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ bb0:
destroy_value %9 : $String
%12 = tuple ()
return %12 : $()
// CHECK-DAG [[STRINGUSE:%[0-9]+]] = function_ref @useFormatString
// CHECK-DAG {{%.*}} = apply [[STRINGUSE]]([[STRINGCONST:%[0-9]+]])
// CHECK-DAG [[STRINGCONST]] = apply [[STRINGINIT:%[0-9]+]]([[LIT:%[0-9]+]], {{%.*}}, {{%.*}}, {{%.*}})
// CHECK-DAG [[STRINGINIT]] = function_ref @$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC
// CHECK-DAG [[LIT]] = string_literal oslog "test message: %lld"
// CHECK-DAG destroy_value [[STRINGCONST]] : $String
// CHECK-DAG: [[STRINGUSE:%[0-9]+]] = function_ref @useFormatString
// CHECK-DAG: {{%.*}} = apply [[STRINGUSE]]([[STRINGCONST:%[0-9]+]])
// CHECK-DAG: [[STRINGCONST]] = apply [[STRINGINIT:%[0-9]+]]([[LIT:%[0-9]+]], {{%.*}}, {{%.*}}, {{%.*}})
// CHECK-DAG: [[STRINGINIT]] = function_ref @$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC
// CHECK-DAG: [[LIT]] = string_literal oslog "test message: %lld"
// CHECK-DAG: destroy_value [[STRINGCONST]] : $String
}

// Test that the OSLogOptimization pass does not fold instructions that define
Expand Down
4 changes: 2 additions & 2 deletions test/SILOptimizer/alloc_vector_lowering.sil
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ bb3:
// CHECK: [[P:%.*]] = address_to_pointer [[G]]
// CHECK: [[UMP:%.*]] = struct $UnsafeMutablePointer<Int64> ([[P]] : $Builtin.RawPointer)
// CHECK: [[BA:%.*]] = struct_element_addr {{%.*}} : $*FixedArray<Int64>, #FixedArray.buffer
// CHECK store [[UMP]] to [trivial] [[BA]]
// CHECK: store [[UMP]] to [trivial] [[BA]]
// CHECK: } // end sil function 'global_init_with_array_initialization'
sil [global_init_once_fn] [ossa] @global_init_with_array_initialization : $@convention(thin) () -> () {
bb0:
Expand Down Expand Up @@ -133,7 +133,7 @@ bb0:
// CHECK: [[G:%.*]] = global_addr @global_init_uninitializedTv_
// CHECK: [[P:%.*]] = address_to_pointer [[G]]
// CHECK: [[UMP:%.*]] = struct $UnsafeMutablePointer<Int64> ([[P]] : $Builtin.RawPointer)
// CHECK store [[UMP]] to [trivial] [[A]]
// CHECK: store [[UMP]] to [trivial] [[A]]
// CHECK: } // end sil function 'global_init_uninitialized'
sil [global_init_once_fn] [ossa] @global_init_uninitialized : $@convention(thin) () -> () {
bb0:
Expand Down
4 changes: 2 additions & 2 deletions test/SILOptimizer/allocboxtostack_localapply.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ public func testrecur() -> Int {
// AppliesToSpecialize should have the order: bar bas common.
// Only then, the functions get specialized correctly, and we won't see an assert in checkNoPromotedBoxInApply.
// CHECK-LABEL: sil [noinline] @$s26allocboxtostack_localapply8testdfs1SiyF :
// CHECK-NOT : alloc_box ${ var Int }, var, name "x"
// CHECK-NOT : alloc_box ${ var Int }, var, name "y"
// CHECK-NOT: alloc_box ${ var Int }, var, name "x"
// CHECK-NOT: alloc_box ${ var Int }, var, name "y"
// CHECK-LABEL:} // end sil function '$s26allocboxtostack_localapply8testdfs1SiyF'
@inline(never)
public func testdfs1() -> Int {
Expand Down
4 changes: 2 additions & 2 deletions test/SILOptimizer/allocboxtostack_localapply_ossa.sil
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ struct Int {
// AppliesToSpecialize should have the order: bar bas common.
// Only then, the functions get specialized correctly, and we won't see an assert in checkNoPromotedBoxInApply.
// CHECK-LABEL: sil [noinline] [ossa] @$testdfs1 :
// CHECK-NOT : alloc_box ${ var Int64 }, var, name "x"
// CHECK-NOT : alloc_box ${ var Int64 }, var, name "y"
// CHECK-NOT: alloc_box ${ var Int64 }, var, name "x"
// CHECK-NOT: alloc_box ${ var Int64 }, var, name "y"
// CHECK-LABEL:} // end sil function '$testdfs1'
sil [noinline] [ossa] @$testdfs1 : $@convention(thin) () -> Int64 {
bb0:
Expand Down
8 changes: 4 additions & 4 deletions test/SILOptimizer/cross-module-optimization.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ import Test
func testNestedTypes() {
let c = Container()

// CHECK-OUTPUT [Test.Container.Base]
// CHECK-OUTPUT: [Test.Container.Base]
// CHECK-OUTPUT: 27
// CHECK-SIL-DAG: sil shared [noinline] @$s4Test9ContainerV9testclassyxxlFSi_Tg5
print(c.testclass(27))
// CHECK-OUTPUT [Test.Container.Base]
// CHECK-OUTPUT: [Test.Container.Base]
// CHECK-OUTPUT: 27
// CHECK-SIL-DAG: sil public_external {{.*}} @$s4Test9ContainerV13testclass_genyxxlF
print(c.testclass_gen(27))
// CHECK-OUTPUT [Test.PE<Swift.Int>.B(27)]
// CHECK-OUTPUT: [Test.PE<Swift.Int>.B(27)]
// CHECK-OUTPUT: 27
// CHECK-SIL-DAG: sil shared [noinline] @$s4Test9ContainerV8testenumyxxlFSi_Tg5
print(c.testenum(27))
// CHECK-OUTPUT [Test.PE<Swift.Int>.B(27)]
// CHECK-OUTPUT: [Test.PE<Swift.Int>.B(27)]
// CHECK-OUTPUT: 27
// CHECK-SIL-DAG: sil public_external {{.*}} @$s4Test9ContainerV12testenum_genyxxlF
print(c.testenum_gen(27))
Expand Down
2 changes: 1 addition & 1 deletion test/SILOptimizer/existential_spl_witness_method.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class D : Q {
// CHECK: apply [[FR1]]
// CHECK-LABEL: } // end sil function '$s30existential_spl_witness_method1CCAA1PA2aDP7myfuncPySiAA1Q_pFTW'

// CHECK-LABEL : @$s30existential_spl_witness_method3bazyyAA1P_p_AA1Q_ptFTf4ee_n : $@convention(thin) <τ_0_0, τ_0_1 where τ_0_0 : P, τ_0_1 : Q> (@in_guaranteed τ_0_0, @in_guaranteed τ_0_1) -> () {
// CHECK-LABEL: @$s30existential_spl_witness_method3bazyyAA1P_p_AA1Q_ptFTf4ee_n : $@convention(thin) <τ_0_0, τ_0_1 where τ_0_0 : P, τ_0_1 : Q> (@in_guaranteed τ_0_0, @in_guaranteed τ_0_1) -> () {
// CHECK: [[FR2:%.*]] = function_ref @$s30existential_spl_witness_method1CCAA1PA2aDP7myfuncPySiAA1Q_pFTW : $@convention(witness_method: P) (@in_guaranteed any Q, @in_guaranteed C) -> Int
// CHECK: apply [[FR2]]
// CHECK-LABEL: } // end sil function '$s30existential_spl_witness_method3bazyyAA1P_p_AA1Q_ptFTf4ee_n'
Expand Down
4 changes: 2 additions & 2 deletions test/SILOptimizer/mandatory_inlining.sil
Original file line number Diff line number Diff line change
Expand Up @@ -1472,8 +1472,8 @@ bb0:

// This test needs the guard malloc to crash without the fix in #35037
// Tests there is no use-after-free in ClosureCleanup::recordDeadFunction when deleting debug instructions
// CHECK-LABEL : sil [ossa] @$test_no_use_after_free :
// CHECK-LABEL : } // end sil function '$test_no_use_after_free'
// CHECK-LABEL: sil [ossa] @$test_no_use_after_free :
// CHECK-LABEL: } // end sil function '$test_no_use_after_free'
sil [ossa] @$test_no_use_after_free : $@convention(thin) () -> () {
bb0:
%12 = function_ref @callee : $@convention(thin) () -> ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public struct ConformingNonTrivialStruct : ResilientProtocol {
// CHECK-NEXT: [[LOAD:%.*]] = load [trivial] [[TMP]] : $*ConformingStruct
// CHECK-NEXT: [[RESULT:%.*]] = apply [[FN]]([[LOAD]])
// CHECK-NEXT: dealloc_stack [[TMP]] : $*ConformingStruct
// CHECK } // end sil function 's8defaultA4main16ConformingStructV_TB5'
// CHECK: } // end sil function '$s8defaultA4main16ConformingStructV_TB5'

// CHECK-LABEL: sil shared [ossa] @$s8defaultA4main26ConformingNonTrivialStructV_TB5
// CHECK: bb0(%0 : @guaranteed $ConformingNonTrivialStruct):
Expand All @@ -43,7 +43,7 @@ public struct ConformingNonTrivialStruct : ResilientProtocol {
// CHECK-NEXT: [[LOAD:%.*]] = load_borrow [[SB]] : $*ConformingNonTrivialStruct
// CHECK-NEXT: [[RESULT:%.*]] = apply [[FN]]([[LOAD]])
// CHECK: dealloc_stack [[TMP]] : $*ConformingNonTrivialStruct
// CHECK } // end sil function 's8defaultA4main16ConformingNonTrivialStructV_TB5'
// CHECK: } // end sil function '$s8defaultA4main26ConformingNonTrivialStructV_TB5'

sil [ossa] @defaultA : $@convention(witness_method: ResilientProtocol) <Self where Self : ResilientProtocol> (@in_guaranteed Self) -> () {
bb0(%0 : $*Self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public func testAvailableElementIfCase(_ e: HasUnavailableElement) {
}

// CHECK-LABEL: sil @$s4Test35testAvailableElementIfCaseResilientyy14resilient_enum0g19EnumWithUnavailableF0OF : $@convention(thin) (@in_guaranteed ResilientEnumWithUnavailableCase) -> () {
// CHECK switch_enum_addr %2 : $*ResilientEnumWithUnavailableCase, case #ResilientEnumWithUnavailableCase.available!enumelt: [[AVAILBB:bb[0-9]+]], default [[DEFAULTBB:bb[0-9]+]]
// CHECK: switch_enum_addr %2 : $*ResilientEnumWithUnavailableCase, case #ResilientEnumWithUnavailableCase.available!enumelt: [[AVAILBB:bb[0-9]+]], default [[DEFAULTBB:bb[0-9]+]]
// CHECK: [[DEFAULTBB]]:
// CHECK-NOT: unreachable
// CHECK: } // end sil function '$s4Test35testAvailableElementIfCaseResilientyy14resilient_enum0g19EnumWithUnavailableF0OF'
Expand Down
2 changes: 1 addition & 1 deletion test/SourceKit/SemanticTokens/semantic_tokens.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var y = MyClass()
// String in line 5
// CHECK: key.kind: source.lang.swift.ref.struct
// CHECK: key.length: 6,
// CHECK key.is_system: 1
// CHECK: key.is_system: 1
// CHECK-LABEL: },

// MyClass in line 6
Expand Down