Files
swift-mirror/test/SIL/Serialization/semanticsattr.sil
Slava Pestov 1e8ce52736 SIL: Strip [serialized] flag from functions even at -Onone
While the comment is correct to state that this won't enable any
new optimizations with -Onone, it does enable IRGen's lazy
function emission, which is important for 'reasync' functions,
which we don't want to emit at all even at -Onone.

This fixes debug stdlib builds with the new reasync versions
of the &&, || and ?? operators.
2021-04-08 01:47:27 -04:00

27 lines
1012 B
Plaintext

// RUN: %empty-directory(%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 - -emit-sorted-sil | %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 [serialized] [_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 [serialized] [_semantics "DEF"] [_semantics "GHI"] @foo2 : $@convention(thin) <T1, T2> () -> () {
bb0:
return undef : $()
}