Skip to content

Commit a6b62d8

Browse files
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.
1 parent f27ed88 commit a6b62d8

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
// compile-flags: --crate-type=rlib -Copt-level=0
2-
// revisions: force-on aarch64-apple aarch64-apple-off
3-
// [force-on] compile-flags: -Cforce-frame-pointers=on
4-
// [aarch64-apple] needs-llvm-components: aarch64
5-
// [aarch64-apple] compile-flags: --target=aarch64-apple-darwin
6-
// [aarch64-apple-off] needs-llvm-components: aarch64
7-
// [aarch64-apple-off] compile-flags: --target=aarch64-apple-darwin -Cforce-frame-pointers=off
1+
//@ add-core-stubs
2+
//@ compile-flags: --crate-type=rlib -Copt-level=0
3+
//@ revisions: force-on aarch64-apple aarch64-apple-on aarch64-apple-off
4+
//@ [force-on] compile-flags: -Cforce-frame-pointers=on
5+
//@ [aarch64-apple] needs-llvm-components: aarch64
6+
//@ [aarch64-apple] compile-flags: --target=aarch64-apple-darwin
7+
//@ [aarch64-apple-on] needs-llvm-components: aarch64
8+
//@ [aarch64-apple-on] compile-flags: --target=aarch64-apple-darwin -Cforce-frame-pointers=on
9+
//@ [aarch64-apple-off] needs-llvm-components: aarch64
10+
//@ [aarch64-apple-off] compile-flags: --target=aarch64-apple-darwin -Cforce-frame-pointers=off
811
/*
912
Tests that the frame pointers can be controlled by the CLI. We find aarch64-apple-darwin useful
1013
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
1619
*/
1720
#![feature(no_core, lang_items)]
1821
#![no_core]
19-
#[lang = "sized"]
20-
trait Sized {}
21-
#[lang = "copy"]
22-
trait Copy {}
23-
impl Copy for u32 {}
22+
23+
extern crate minicore;
2424

2525
// CHECK: define i32 @peach{{.*}}[[PEACH_ATTRS:\#[0-9]+]] {
2626
#[no_mangle]
@@ -30,6 +30,7 @@ pub fn peach(x: u32) -> u32 {
3030

3131
// CHECK: attributes [[PEACH_ATTRS]] = {
3232
// force-on-SAME: {{.*}}"frame-pointer"="all"
33-
// aarch64-apple-SAME: {{.*}}"frame-pointer"="all"
33+
// aarch64-apple-SAME: {{.*}}"frame-pointer"="non-leaf"
34+
// aarch64-apple-on-SAME: {{.*}}"frame-pointer"="all"
3435
// aarch64-apple-off-NOT: {{.*}}"frame-pointer"{{.*}}
3536
// CHECK-SAME: }

0 commit comments

Comments
 (0)