Files
swift-mirror/test/SIL/Serialization/dynamically_replaceable.sil
Jordan Rose c06e105bd0 [Serialization] Switch to a better hash seed for lookup tables
...fulfilling the promised audit from 0747d9a339. No intended
functionality change /other/ than the order of already-unsorted lists.
This affected a number of SIL tests that relied on deserialization
order matching the original source order; I have no idea why the old
hash logic would make that the case. If we think that's a valuable
property, we should serialize a list of functions in addition to the
iterable table. (Maybe just in SIB mode?)
2019-08-29 09:20:18 -07:00

32 lines
1.3 KiB
Plaintext

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend %s -emit-module -o %t/tmp.swiftmodule
// RUN: %target-sil-opt %t/tmp.swiftmodule -disable-sil-linking -emit-sorted-sil | %FileCheck %s
// CHECK-DAG-LABEL: sil [serialized] [dynamically_replacable] [canonical] @test_dynamically_replaceable
sil [serialized] [dynamically_replacable] @test_dynamically_replaceable : $@convention(thin) () -> () {
bb0:
%0 = tuple ()
return %0 : $()
}
// CHECK-DAG-LABEL: sil [serialized] [dynamic_replacement_for "test_dynamically_replaceable"] [canonical] @test_dynamic_replacement_for
// CHECK: prev_dynamic_function_ref @test_dynamic_replacement_for
sil [serialized] [dynamic_replacement_for "test_dynamically_replaceable"] @test_dynamic_replacement_for : $@convention(thin) () -> () {
bb0:
%0 = prev_dynamic_function_ref @test_dynamic_replacement_for : $@convention(thin) () -> ()
%1 = apply %0() : $@convention(thin) () -> ()
%2 = tuple ()
return %2 : $()
}
// CHECK-DAG-LABEL: sil [serialized] [canonical] @test_dynamically_replaceable_impl
// CHECK: dynamic_function_ref @test_dynamically_replaceable
sil [serialized] @test_dynamically_replaceable_impl : $@convention(thin) () -> () {
bb0:
%0 = dynamic_function_ref @test_dynamically_replaceable : $@convention(thin) () -> ()
%1 = apply %0() : $@convention(thin) () -> ()
%2 = tuple ()
return %2 : $()
}