diff options
| author | bors <bors@rust-lang.org> | 2022-09-29 08:00:54 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-09-29 08:00:54 +0000 |
| commit | 8a497b7181cad4ae66dbd6cc31042b69b6bd0df7 (patch) | |
| tree | 5047eaf4c4461f254b9f7b9cd7e6921eb4a16f9b /src/test/codegen | |
| parent | 1536a53ea4798df052dc31a611c2f29c8f529be7 (diff) | |
| parent | ad8f519ed75ebaf12e2a2b56f2a580cfae87a75a (diff) | |
| download | rust-8a497b7181cad4ae66dbd6cc31042b69b6bd0df7.tar.gz rust-8a497b7181cad4ae66dbd6cc31042b69b6bd0df7.zip | |
Auto merge of #102328 - cuviper:ibm-stack-probes, r=nagisa
Enable inline stack probes on PowerPC and SystemZ The LLVM PowerPC and SystemZ targets have both supported `"probe-stack"="inline-asm"` for longer than our current minimum LLVM 13 requirement, so we can turn this on for all `powerpc`, `powerpc64`, `powerpc64le`, and `s390x` targets in Rust. These are all tier-2 or lower, so CI does not run their tests, but I have confirmed that their `linux-gnu` variants do pass on RHEL. cc #43241
Diffstat (limited to 'src/test/codegen')
| -rw-r--r-- | src/test/codegen/stack-probes-call.rs | 22 | ||||
| -rw-r--r-- | src/test/codegen/stack-probes-inline.rs | 26 | ||||
| -rw-r--r-- | src/test/codegen/stack-probes.rs | 22 |
3 files changed, 48 insertions, 22 deletions
diff --git a/src/test/codegen/stack-probes-call.rs b/src/test/codegen/stack-probes-call.rs new file mode 100644 index 00000000000..56b02fdecad --- /dev/null +++ b/src/test/codegen/stack-probes-call.rs @@ -0,0 +1,22 @@ +// Check the "probe-stack" attribute for targets with `StackProbeType::Call`, +// or `StackProbeType::InlineOrCall` when running on older LLVM. + +// compile-flags: -C no-prepopulate-passes +// revisions: i686 x86_64 +//[i686] compile-flags: --target i686-unknown-linux-gnu +//[i686] needs-llvm-components: x86 +//[x86_64] compile-flags: --target x86_64-unknown-linux-gnu +//[x86_64] needs-llvm-components: x86 + +#![crate_type = "rlib"] +#![feature(no_core, lang_items)] +#![no_core] + +#[lang = "sized"] +trait Sized {} + +#[no_mangle] +pub fn foo() { +// CHECK: @foo() unnamed_addr #0 +// CHECK: attributes #0 = { {{.*}}"probe-stack"="__rust_probestack"{{.*}} } +} diff --git a/src/test/codegen/stack-probes-inline.rs b/src/test/codegen/stack-probes-inline.rs new file mode 100644 index 00000000000..837a1610810 --- /dev/null +++ b/src/test/codegen/stack-probes-inline.rs @@ -0,0 +1,26 @@ +// Check the "probe-stack" attribute for targets with `StackProbeType::Inline`, +// or `StackProbeType::InlineOrCall` when running on newer LLVM. + +// compile-flags: -C no-prepopulate-passes +// revisions: powerpc powerpc64 powerpc64le s390x +//[powerpc] compile-flags: --target powerpc-unknown-linux-gnu +//[powerpc] needs-llvm-components: powerpc +//[powerpc64] compile-flags: --target powerpc64-unknown-linux-gnu +//[powerpc64] needs-llvm-components: powerpc +//[powerpc64le] compile-flags: --target powerpc64le-unknown-linux-gnu +//[powerpc64le] needs-llvm-components: powerpc +//[s390x] compile-flags: --target s390x-unknown-linux-gnu +//[s390x] needs-llvm-components: systemz + +#![crate_type = "rlib"] +#![feature(no_core, lang_items)] +#![no_core] + +#[lang = "sized"] +trait Sized {} + +#[no_mangle] +pub fn foo() { +// CHECK: @foo() unnamed_addr #0 +// CHECK: attributes #0 = { {{.*}}"probe-stack"="inline-asm"{{.*}} } +} diff --git a/src/test/codegen/stack-probes.rs b/src/test/codegen/stack-probes.rs deleted file mode 100644 index 9bd351df3ea..00000000000 --- a/src/test/codegen/stack-probes.rs +++ /dev/null @@ -1,22 +0,0 @@ -// ignore-arm -// ignore-aarch64 -// ignore-mips -// ignore-mips64 -// ignore-powerpc -// ignore-powerpc64 -// ignore-powerpc64le -// ignore-riscv64 -// ignore-s390x -// ignore-sparc -// ignore-sparc64 -// ignore-wasm -// ignore-emscripten -// ignore-windows -// compile-flags: -C no-prepopulate-passes - -#![crate_type = "lib"] - -#[no_mangle] -pub fn foo() { -// CHECK: @foo() unnamed_addr #0 -} |
