diff options
Diffstat (limited to '')
-rw-r--r-- | tests/assembly/is_aligned.rs | 1 | ||||
-rw-r--r-- | tests/assembly/slice-is_ascii.rs | 1 | ||||
-rw-r--r-- | tests/assembly/stack-protector/stack-protector-heuristics-effect.rs | 1 | ||||
-rw-r--r-- | tests/assembly/stack-protector/stack-protector-target-support.rs | 26 | ||||
-rw-r--r-- | tests/assembly/strict_provenance.rs | 1 | ||||
-rw-r--r-- | tests/assembly/wasm_exceptions.rs | 60 |
6 files changed, 75 insertions, 15 deletions
diff --git a/tests/assembly/is_aligned.rs b/tests/assembly/is_aligned.rs index 148d11ee4..d152d200a 100644 --- a/tests/assembly/is_aligned.rs +++ b/tests/assembly/is_aligned.rs @@ -1,5 +1,4 @@ // assembly-output: emit-asm -// min-llvm-version: 15.0 // only-x86_64 // ignore-sgx // revisions: opt-speed opt-size diff --git a/tests/assembly/slice-is_ascii.rs b/tests/assembly/slice-is_ascii.rs index b3e1fee15..124121164 100644 --- a/tests/assembly/slice-is_ascii.rs +++ b/tests/assembly/slice-is_ascii.rs @@ -3,7 +3,6 @@ // [LIN] only-linux // assembly-output: emit-asm // compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel -// min-llvm-version: 14 // only-x86_64 // ignore-sgx // ignore-debug diff --git a/tests/assembly/stack-protector/stack-protector-heuristics-effect.rs b/tests/assembly/stack-protector/stack-protector-heuristics-effect.rs index 011a253c6..a7c9e4845 100644 --- a/tests/assembly/stack-protector/stack-protector-heuristics-effect.rs +++ b/tests/assembly/stack-protector/stack-protector-heuristics-effect.rs @@ -3,6 +3,7 @@ // ignore-macos slightly different policy on stack protection of arrays // ignore-windows stack check code uses different function names // ignore-nvptx64 stack protector is not supported +// ignore-wasm32-bare // [all] compile-flags: -Z stack-protector=all // [strong] compile-flags: -Z stack-protector=strong // [basic] compile-flags: -Z stack-protector=basic diff --git a/tests/assembly/stack-protector/stack-protector-target-support.rs b/tests/assembly/stack-protector/stack-protector-target-support.rs index d5b48105e..e5cbace80 100644 --- a/tests/assembly/stack-protector/stack-protector-target-support.rs +++ b/tests/assembly/stack-protector/stack-protector-target-support.rs @@ -152,28 +152,30 @@ // [r72] needs-llvm-components: webassembly // [r73] compile-flags:--target wasm32-wasi // [r73] needs-llvm-components: webassembly -// [r74] compile-flags:--target x86_64-apple-ios -// [r74] needs-llvm-components: x86 -// [r75] compile-flags:--target x86_64-fortanix-unknown-sgx +// [r74] compile-flags:--target wasm32-wasi-preview1-threads +// [r74] needs-llvm-components: webassembly +// [r75] compile-flags:--target x86_64-apple-ios // [r75] needs-llvm-components: x86 -// [r76] compile-flags:--target x86_64-unknown-fuchsia +// [r76] compile-flags:--target x86_64-fortanix-unknown-sgx // [r76] needs-llvm-components: x86 -// [r77] compile-flags:--target x86_64-linux-android +// [r77] compile-flags:--target x86_64-unknown-fuchsia // [r77] needs-llvm-components: x86 -// [r78] compile-flags:--target x86_64-sun-solaris +// [r78] compile-flags:--target x86_64-linux-android // [r78] needs-llvm-components: x86 -// [r79] compile-flags:--target x86_64-unknown-freebsd +// [r79] compile-flags:--target x86_64-sun-solaris // [r79] needs-llvm-components: x86 -// [r80] compile-flags:--target x86_64-unknown-illumos +// [r80] compile-flags:--target x86_64-unknown-freebsd // [r80] needs-llvm-components: x86 -// [r81] compile-flags:--target x86_64-unknown-linux-gnux32 +// [r81] compile-flags:--target x86_64-unknown-illumos // [r81] needs-llvm-components: x86 -// [r82] compile-flags:--target x86_64-unknown-linux-musl +// [r82] compile-flags:--target x86_64-unknown-linux-gnux32 // [r82] needs-llvm-components: x86 -// [r83] compile-flags:--target x86_64-unknown-netbsd +// [r83] compile-flags:--target x86_64-unknown-linux-musl // [r83] needs-llvm-components: x86 -// [r84] compile-flags: --target x86_64-unknown-redox +// [r84] compile-flags:--target x86_64-unknown-netbsd // [r84] needs-llvm-components: x86 +// [r85] compile-flags: --target x86_64-unknown-redox +// [r85] needs-llvm-components: x86 // compile-flags: -Z stack-protector=all // compile-flags: -C opt-level=2 diff --git a/tests/assembly/strict_provenance.rs b/tests/assembly/strict_provenance.rs index 24a7c6b5b..ef8566a93 100644 --- a/tests/assembly/strict_provenance.rs +++ b/tests/assembly/strict_provenance.rs @@ -2,7 +2,6 @@ // compile-flags: -Copt-level=1 // only-x86_64 // ignore-sgx -// min-llvm-version: 15.0 #![crate_type = "rlib"] // CHECK-LABEL: old_style diff --git a/tests/assembly/wasm_exceptions.rs b/tests/assembly/wasm_exceptions.rs new file mode 100644 index 000000000..b7d20881b --- /dev/null +++ b/tests/assembly/wasm_exceptions.rs @@ -0,0 +1,60 @@ +// only-wasm32-bare +// assembly-output: emit-asm +// compile-flags: -C target-feature=+exception-handling +// compile-flags: -C panic=unwind +// compile-flags: -C llvm-args=-wasm-enable-eh + +#![crate_type = "lib"] +#![feature(core_intrinsics)] +#![feature(rustc_attrs)] + +extern { + fn may_panic(); + + #[rustc_nounwind] + fn log_number(number: usize); +} + +struct LogOnDrop; + +impl Drop for LogOnDrop { + fn drop(&mut self) { + unsafe { log_number(0); } + } +} + +// CHECK-LABEL: test_cleanup: +#[no_mangle] +pub fn test_cleanup() { + let _log_on_drop = LogOnDrop; + unsafe { may_panic(); } + + // CHECK-NOT: call + // CHECK: try + // CHECK: call may_panic + // CHECK: catch_all + // CHECK: rethrow + // CHECK: end_try +} + +// CHECK-LABEL: test_rtry: +#[no_mangle] +pub fn test_rtry() { + unsafe { + core::intrinsics::r#try(|_| { + may_panic(); + }, core::ptr::null_mut(), |data, exception| { + log_number(data as usize); + log_number(exception as usize); + }); + } + + // CHECK-NOT: call + // CHECK: try + // CHECK: call may_panic + // CHECK: catch + // CHECK: call log_number + // CHECK: call log_number + // CHECK-NOT: rethrow + // CHECK: end_try +} |