mirror of
https://github.com/apple/swift.git
synced 2026-10-22 19:15:50 +02:00
Building with `build-script --swift-darwin-supported-archs "$(uname -m)" --test` makes for a lot of failed tests due to standard library use with hard coded architectures. Some of these can use `%target-cpu` instead of a hard coded architecture, but some of them really do rely on the standard library being built for a particular architecture. Set the archs used to build the standard library in `SWIFT_STDLIB_ARCH=` features, and then use those to filter out tests that require the standard library in a different architecture. Assisted-by: Claude Code rdar://180485531
73 lines
2.5 KiB
Plaintext
73 lines
2.5 KiB
Plaintext
// RUN: %target-swift-frontend -target arm64-apple-ios8.0 -primary-file %s -emit-ir | %FileCheck %s --check-prefix=CHECK
|
|
// RUN: %target-swift-frontend -target arm64-apple-ios8.0 -primary-file %s -emit-ir -Xcc -mno-omit-leaf-frame-pointer| %FileCheck %s --check-prefix=CHECK-ALL
|
|
// RUN: %target-swift-frontend -target arm64-apple-ios8.0 -primary-file %s -S | %FileCheck %s --check-prefix=CHECKASM
|
|
// RUN: %target-swift-frontend -target arm64-apple-ios8.0 -primary-file %s -S -Xcc -mno-omit-leaf-frame-pointer | %FileCheck %s --check-prefix=CHECKASM-ALL
|
|
|
|
// REQUIRES: CODEGENERATOR=AArch64
|
|
// REQUIRES: SWIFT_STDLIB_ARCH=arm64
|
|
// REQUIRES: OS=ios
|
|
|
|
sil_stage canonical
|
|
|
|
import Swift
|
|
|
|
sil @leaf_function_no_frame_pointer : $@convention(thin) (Int32) -> Int32 {
|
|
entry(%i : $Int32):
|
|
return %i : $Int32
|
|
}
|
|
|
|
sil @non_leaf_function_with_frame_pointer : $@convention(thin) (Int32) -> Int32 {
|
|
entry(%i : $Int32):
|
|
%f = function_ref @leaf_function_no_frame_pointer : $@convention(thin) (Int32) -> Int32
|
|
%r = apply %f(%i) : $@convention(thin) (Int32) -> Int32
|
|
return %r : $Int32
|
|
}
|
|
|
|
// CHECK: define{{.*}} swiftcc i32 @leaf_function_no_frame_pointer(i32 %0) [[ATTR:#.*]] {
|
|
// CHECK: entry:
|
|
// CHECK: ret i32 %0
|
|
// CHECK: }
|
|
|
|
// CHECK: define{{.*}} swiftcc i32 @non_leaf_function_with_frame_pointer(i32 %0) [[ATTR]] {
|
|
// CHECK: entry:
|
|
// CHECK: %1 = call swiftcc i32 @leaf_function_no_frame_pointer(i32 %0)
|
|
// CHECK: ret i32 %1
|
|
// CHECK: }
|
|
|
|
// CHECK: attributes [[ATTR]] = {{{.*}}"frame-pointer"="non-leaf"
|
|
|
|
// CHECK-ALL: define{{.*}} swiftcc i32 @leaf_function_no_frame_pointer(i32 %0) [[ATTR:#.*]] {
|
|
// CHECK-ALL: entry:
|
|
// CHECK-ALL: ret i32 %0
|
|
// CHECK-ALL: }
|
|
|
|
// CHECK-ALL: define{{.*}} swiftcc i32 @non_leaf_function_with_frame_pointer(i32 %0) [[ATTR]] {
|
|
// CHECK-ALL: entry:
|
|
// CHECK-ALL: %1 = call swiftcc i32 @leaf_function_no_frame_pointer(i32 %0)
|
|
// CHECK-ALL: ret i32 %1
|
|
// CHECK-ALL: }
|
|
|
|
// CHECK-ALL: attributes [[ATTR]] = {{{.*}}"frame-pointer"="all"
|
|
|
|
// CHECKASM-LABEL: _leaf_function_no_frame_pointer:
|
|
// CHECKASM-NOT: stp
|
|
// CHECKASM-NOT: ldp
|
|
// CHECKASM: ret
|
|
|
|
// CHECKASM-LABEL: _non_leaf_function_with_frame_pointer:
|
|
// CHECKASM: stp
|
|
// CHECKASM: _leaf_function_no_frame_pointer
|
|
// CHECKASM: ldp
|
|
// CHECKASM: ret
|
|
|
|
// CHECKASM-ALL-LABEL: _leaf_function_no_frame_pointer:
|
|
// CHECKASM-ALL: stp
|
|
// CHECKASM-ALL: ldp
|
|
// CHECKASM-ALL: ret
|
|
|
|
// CHECKASM-ALL-LABEL: _non_leaf_function_with_frame_pointer:
|
|
// CHECKASM-ALL: stp
|
|
// CHECKASM-ALL: _leaf_function_no_frame_pointer
|
|
// CHECKASM-ALL: ldp
|
|
// CHECKASM-ALL: ret
|