@@ -68,7 +68,7 @@ struct MemberTests {
6868
6969@runtimeMetadata
7070struct Flag < U> {
71- init < T> ( attachedTo: T , value: U ) { }
71+ init < T> ( attachedTo: T , value: U , function : String = #function ) { }
7272}
7373
7474struct TestSelfUse {
@@ -84,8 +84,10 @@ struct TestSelfUse {
8484 // CHECK-NEXT: end_access [[PROP_ACCESS]] : $*Int
8585 // CHECK: [[PROP_VAL_COPY:%.*]] = alloc_stack $Int
8686 // CHECK: store [[PROP_VALUE]] to [trivial] [[PROP_VAL_COPY]] : $*Int
87- // CHECK: [[FLAG_INIT_REF:%.*]] = function_ref @$s18runtime_attributes4FlagV10attachedTo5valueACyxGqd___xtclufC
88- // CHECK-NEXT: {{.*}} = apply [[FLAG_INIT_REF]]<Int, WritableKeyPath<TestSelfUse, String>>({{.*}}, [[PROP_VAL_COPY]], {{.*}})
87+ // CHECK: [[FUNC_NAME:%.*]] = string_literal utf8 "x"
88+ // CHECK: [[FUNC_NAME_STR:%.*]] = apply {{.*}}([[FUNC_NAME]], {{.*}})
89+ // CHECK: [[FLAG_INIT_REF:%.*]] = function_ref @$s18runtime_attributes4FlagV10attachedTo5value8functionACyxGqd___xSStclufC
90+ // CHECK-NEXT: {{.*}} = apply [[FLAG_INIT_REF]]<Int, WritableKeyPath<TestSelfUse, String>>({{.*}}, [[PROP_VAL_COPY]], [[FUNC_NAME_STR]], {{.*}})
8991 @Flag ( value: Self . answer) var x : String = " "
9092
9193 // CHECK-LABEL: sil hidden [runtime_accessible] [ossa] @$s18runtime_attributes11TestSelfUseV4testyycvpfaAA4Flag : $@convention(thin) () -> @out Optional<Flag<String>>
@@ -97,7 +99,9 @@ struct TestSelfUse {
9799 // CHECK-NEXT: end_access [[PROP_ACCESS]] : $*String
98100 // CHECK: [[PROP_VAL_COPY:%.*]] = alloc_stack $String
99101 // CHECK: store [[PROP_VALUE]] to [init] [[PROP_VAL_COPY]] : $*String
100- // CHECK: [[FLAG_INIT_REF:%.*]] = function_ref @$s18runtime_attributes4FlagV10attachedTo5valueACyxGqd___xtclufC
101- // CHECK-NEXT: {{.*}} = apply [[FLAG_INIT_REF]]<String, (TestSelfUse) -> ()>({{.*}}, [[PROP_VAL_COPY]], {{.*}})
102+ // CHECK: [[FUNC_NAME:%.*]] = string_literal utf8 "test()"
103+ // CHECK: [[FUNC_NAME_STR:%.*]] = apply {{.*}}([[FUNC_NAME]], {{.*}})
104+ // CHECK: [[FLAG_INIT_REF:%.*]] = function_ref @$s18runtime_attributes4FlagV10attachedTo5value8functionACyxGqd___xSStclufC
105+ // CHECK-NEXT: {{.*}} = apply [[FLAG_INIT_REF]]<String, (TestSelfUse) -> ()>({{.*}}, [[PROP_VAL_COPY]], [[FUNC_NAME_STR]], {{.*}})
102106 @Flag ( value: Self . question) func test( ) { }
103107}
0 commit comments