File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
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
8
+ /*
9
+ Tests that the frame pointers can be controlled by the CLI. We find aarch64-apple-darwin useful
10
+ because of its icy-clear policy regarding frame pointers (software SHALL be compiled with them),
11
+ e.g. https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms says:
12
+
13
+ * The frame pointer register (x29) must always address a valid frame record. Some functions —
14
+ such as leaf functions or tail calls — may opt not to create an entry in this list.
15
+ As a result, stack traces are always meaningful, even without debug information.
16
+ */
17
+ #![ feature( no_core, lang_items) ]
18
+ #![ no_core]
19
+ #[ lang = "sized" ]
20
+ trait Sized { }
21
+ #[ lang = "copy" ]
22
+ trait Copy { }
23
+ impl Copy for u32 { }
24
+
25
+ // CHECK: define i32 @peach{{.*}}[[PEACH_ATTRS:\#[0-9]+]] {
26
+ #[ no_mangle]
27
+ pub fn peach ( x : u32 ) -> u32 {
28
+ x
29
+ }
30
+
31
+ // CHECK: attributes [[PEACH_ATTRS]] = {
32
+ // force-on-SAME: {{.*}}"frame-pointer"="all"
33
+ // aarch64-apple-SAME: {{.*}}"frame-pointer"="all"
34
+ // aarch64-apple-off-NOT: {{.*}}"frame-pointer"{{.*}}
35
+ // CHECK-SAME: }
You can’t perform that action at this time.
0 commit comments