Files
swift-mirror/test/IRGen/ordering_arm.sil
Arnold Schwaighofer 39fa2f0228 Use the swift calling convention for swift functions
Use the generic type lowering algorithm described in
"docs/CallingConvention.rst#physical-lowering" to map from IRGen's explosion
type to the type expected by the ABI.

Change IRGen to use the swift calling convention (swiftcc) for native swift
functions.

Use the 'swiftself' attribute on self parameters and for closures contexts.

Use the 'swifterror' parameter for swift error parameters.

Change functions in the runtime that are called as native swift functions to use
the swift calling convention.

rdar://19978563
2017-02-14 12:17:57 -08:00

34 lines
942 B
Plaintext

// RUN: %swift -target armv7-apple-ios7.1 %s -module-name main -emit-ir -o - | %FileCheck %s
// REQUIRES: CODEGENERATOR=ARM
sil_stage canonical
sil @foo : $@convention(thin) () -> () {
bb0:
// In a simple module-appending scheme where we emitted SIL
// functions in order, this function reference would cause
// @baz to be created immediately following @foo because we
// won't yet have created the declaration for @bar.
%0 = function_ref @baz : $@convention(thin) () -> ()
%1 = apply %0() : $@convention(thin) () -> ()
return %1 : $()
}
sil @bar : $@convention(thin) () -> () {
bb0:
%0 = tuple ()
return %0 : $()
}
sil @baz : $@convention(thin) () -> () {
bb0:
%0 = tuple ()
return %0 : $()
}
// Make sure that these functions are emitted in the order they
// CHECK: define{{( protected)?}} swiftcc void @foo
// CHECK: define{{( protected)?}} swiftcc void @bar
// CHECK: define{{( protected)?}} swiftcc void @baz