Files
swift-mirror/test/SIL/Serialization/semanticsattr.sil
Jordan Rose 740b9f96bf [test] Make some SIL serialization tests not order-dependent.
The order of keys in a serialized hash map is deterministic (consistent
across runs of the same compiler and same input) but not specified
(not consistent across compiler versions or modified inputs). Tweak two
tests to avoid this issue: one by sorting the output, the other by
using CHECK-DAG to ignore ordering issues.

rdar://problem/25492781&25497592
2016-04-18 20:53:43 -07:00

28 lines
994 B
Plaintext

// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: %target-swift-frontend -parse-sil -emit-sib -parse-as-library -parse-stdlib -module-name SemanticsAttr -o %t/SemanticsAttr.sib %s
// RUN: %target-sil-opt %t/SemanticsAttr.sib -o - -sil-sort-output | FileCheck %s
sil_stage canonical
import Builtin
// CHECK: @_semantics("123") @_semantics("456") func semanticsFunction() -> Builtin.Int64
@_semantics("123") @_semantics("456")
func semanticsFunction() -> Builtin.Int64
// CHECK: sil [_semantics "789"] [_semantics "ABC"] @foo1 : $@convention(thin) () -> () {
sil public [_semantics "789"] [_semantics "ABC"] @foo1 : $@convention(thin) () -> () {
bb0:
return undef : $()
}
// Make sure that we can parse with multiple generics that are after the semantic attributes.
//
// CHECK: sil [_semantics "DEF"] [_semantics "GHI"] @foo2 : $@convention(thin) <T1, T2> () -> () {
sil public [_semantics "DEF"] [_semantics "GHI"] @foo2 : $@convention(thin) <T1, T2> () -> () {
bb0:
return undef : $()
}