1 // min-llvm-version: 16
2 // revisions: x86_64 i686
3 // assembly-output: emit-asm
4 //[x86_64] compile-flags: --target x86_64-unknown-linux-gnu
5 //[x86_64] needs-llvm-components: x86
6 //[i686] compile-flags: --target i686-unknown-linux-gnu
7 //[i686] needs-llvm-components: x86
8 // compile-flags: -C llvm-args=-x86-asm-syntax=intel
10 #![feature(no_core, lang_items)]
11 #![crate_type = "lib"]
21 // Check that inline-asm stack probes are generated correctly.
22 // To avoid making this test fragile to slight asm changes,
23 // we only check that the stack pointer is decremented by a page at a time,
24 // instead of matching the whole probe sequence.
26 // CHECK-LABEL: small_stack_probe:
28 pub fn small_stack_probe(x: u8, f: fn(&mut [u8; 8192])) {
29 // CHECK-NOT: __rust_probestack
30 // x86_64: sub rsp, 4096
31 // i686: sub esp, 4096
35 // CHECK-LABEL: big_stack_probe:
37 pub fn big_stack_probe(x: u8, f: fn(&[u8; 65536])) {
38 // CHECK-NOT: __rust_probestack
39 // x86_64: sub rsp, 4096
40 // i686: sub esp, 4096