about summary refs log tree commit diff
path: root/tests/codegen/frame-pointer-cli-control.rs
diff options
context:
space:
mode:
authorJubilee Young <workingjubilee@gmail.com>2024-05-15 21:57:01 -0700
committerJubilee Young <workingjubilee@gmail.com>2025-06-05 13:28:42 -0700
commita6b62d893f620e81cc04a39acd67e6f638d29358 (patch)
tree761e0a02348cd3f12fca61c001c0768d2d74c975 /tests/codegen/frame-pointer-cli-control.rs
parentf27ed880531867fa548c9780144558cecb6fbe71 (diff)
downloadrust-a6b62d893f620e81cc04a39acd67e6f638d29358.tar.gz
rust-a6b62d893f620e81cc04a39acd67e6f638d29358.zip
codegen: modernize frame-pointer-cli-control.rs
Update this time-traveler on the changes in compiletest and target specs
that they missed over the pass ~3 years by being caught in a time rift.
The aarch64-apple rev splits into itself and aarch64-apple-on, because
rustc obtained support for non-leaf frame-pointers ever since 9b67cba
implemented them and used them in aarch64-apple-darwin's spec.

Note that the aarch64-apple-off revision fails, despite modernization.
This is because 9b67cba also changed the behavior of rustc to defer to
the spec over the command-line interface.
Diffstat (limited to 'tests/codegen/frame-pointer-cli-control.rs')
-rw-r--r--tests/codegen/frame-pointer-cli-control.rs27
1 files changed, 14 insertions, 13 deletions
diff --git a/tests/codegen/frame-pointer-cli-control.rs b/tests/codegen/frame-pointer-cli-control.rs
index 12282eea8f4..2ce9fa22ddb 100644
--- a/tests/codegen/frame-pointer-cli-control.rs
+++ b/tests/codegen/frame-pointer-cli-control.rs
@@ -1,10 +1,13 @@
-// compile-flags: --crate-type=rlib -Copt-level=0
-// revisions: force-on aarch64-apple aarch64-apple-off
-// [force-on] compile-flags: -Cforce-frame-pointers=on
-// [aarch64-apple] needs-llvm-components: aarch64
-// [aarch64-apple] compile-flags: --target=aarch64-apple-darwin
-// [aarch64-apple-off] needs-llvm-components: aarch64
-// [aarch64-apple-off] compile-flags: --target=aarch64-apple-darwin -Cforce-frame-pointers=off
+//@ add-core-stubs
+//@ compile-flags: --crate-type=rlib -Copt-level=0
+//@ revisions: force-on aarch64-apple aarch64-apple-on aarch64-apple-off
+//@ [force-on] compile-flags: -Cforce-frame-pointers=on
+//@ [aarch64-apple] needs-llvm-components: aarch64
+//@ [aarch64-apple] compile-flags: --target=aarch64-apple-darwin
+//@ [aarch64-apple-on] needs-llvm-components: aarch64
+//@ [aarch64-apple-on] compile-flags: --target=aarch64-apple-darwin -Cforce-frame-pointers=on
+//@ [aarch64-apple-off] needs-llvm-components: aarch64
+//@ [aarch64-apple-off] compile-flags: --target=aarch64-apple-darwin -Cforce-frame-pointers=off
 /*
 Tests that the frame pointers can be controlled by the CLI. We find aarch64-apple-darwin useful
 because of its icy-clear policy regarding frame pointers (software SHALL be compiled with them),
@@ -16,11 +19,8 @@ e.g. https://developer.apple.com/documentation/xcode/writing-arm64-code-for-appl
 */
 #![feature(no_core, lang_items)]
 #![no_core]
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
-impl Copy for u32 {}
+
+extern crate minicore;
 
 // CHECK: define i32 @peach{{.*}}[[PEACH_ATTRS:\#[0-9]+]] {
 #[no_mangle]
@@ -30,6 +30,7 @@ pub fn peach(x: u32) -> u32 {
 
 // CHECK: attributes [[PEACH_ATTRS]] = {
 // force-on-SAME: {{.*}}"frame-pointer"="all"
-// aarch64-apple-SAME: {{.*}}"frame-pointer"="all"
+// aarch64-apple-SAME: {{.*}}"frame-pointer"="non-leaf"
+// aarch64-apple-on-SAME: {{.*}}"frame-pointer"="all"
 // aarch64-apple-off-NOT: {{.*}}"frame-pointer"{{.*}}
 // CHECK-SAME: }