Files
swift-mirror/test/Serialization/cdecl_attr.swift
Yuta Saito 992c383023 [Serialization] Serialize hasCReferences to keep linkage
hasCReferences is used to determine that the function is externally
available. If a function has @_cdecl and not used from anywhere in Swift
side code, it will be emitted due to its hasCReferences. But if the
attribute is not restored from sib, it won't be emitted even if it's
used externally. So we need to serialize the attribute.
2020-08-29 02:21:49 +09:00

13 lines
351 B
Swift

// RUN: %empty-directory(%t)
// Ensure .swift -> .ll
// RUN: %target-swift-frontend -emit-ir %s | %FileCheck %s
// Ensure .swift -> .sib -> .ll
// RUN: %target-swift-frontend -emit-sib %s -o %t/cdecl_attr.sib
// RUN: %target-swift-frontend -emit-ir %t/cdecl_attr.sib | %FileCheck %s
// CHECK: define hidden {{.*}} @foo
@_cdecl("foo")
func foo() {}