diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:11:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:11:28 +0000 |
commit | 94a0819fe3a0d679c3042a77bfe6a2afc505daea (patch) | |
tree | 2b827afe6a05f3538db3f7803a88c4587fe85648 /src/test/assembly | |
parent | Adding upstream version 1.64.0+dfsg1. (diff) | |
download | rustc-94a0819fe3a0d679c3042a77bfe6a2afc505daea.tar.xz rustc-94a0819fe3a0d679c3042a77bfe6a2afc505daea.zip |
Adding upstream version 1.66.0+dfsg1.upstream/1.66.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/assembly')
-rw-r--r-- | src/test/assembly/aarch64-pointer-auth.rs | 1 | ||||
-rw-r--r-- | src/test/assembly/asm/aarch64-types.rs | 2 | ||||
-rw-r--r-- | src/test/assembly/asm/arm-types.rs | 2 | ||||
-rw-r--r-- | src/test/assembly/asm/avr-modifiers.rs | 1 | ||||
-rw-r--r-- | src/test/assembly/asm/avr-types.rs | 3 | ||||
-rw-r--r-- | src/test/assembly/asm/bpf-types.rs | 3 | ||||
-rw-r--r-- | src/test/assembly/asm/global_asm.rs | 6 | ||||
-rw-r--r-- | src/test/assembly/asm/hexagon-types.rs | 2 | ||||
-rw-r--r-- | src/test/assembly/asm/mips-types.rs | 2 | ||||
-rw-r--r-- | src/test/assembly/asm/msp430-types.rs | 3 | ||||
-rw-r--r-- | src/test/assembly/asm/nvptx-types.rs | 2 | ||||
-rw-r--r-- | src/test/assembly/asm/powerpc-types.rs | 3 | ||||
-rw-r--r-- | src/test/assembly/asm/riscv-types.rs | 2 | ||||
-rw-r--r-- | src/test/assembly/asm/s390x-types.rs | 2 | ||||
-rw-r--r-- | src/test/assembly/asm/wasm-types.rs | 2 | ||||
-rw-r--r-- | src/test/assembly/asm/x86-types.rs | 2 | ||||
-rw-r--r-- | src/test/assembly/stack-protector/stack-protector-target-support.rs | 1 | ||||
-rw-r--r-- | src/test/assembly/x86-stack-probes.rs | 42 | ||||
-rw-r--r-- | src/test/assembly/x86_64-floating-point-clamp.rs | 25 |
19 files changed, 84 insertions, 22 deletions
diff --git a/src/test/assembly/aarch64-pointer-auth.rs b/src/test/assembly/aarch64-pointer-auth.rs index 27e289086..da14cd026 100644 --- a/src/test/assembly/aarch64-pointer-auth.rs +++ b/src/test/assembly/aarch64-pointer-auth.rs @@ -1,6 +1,5 @@ // Test that PAC instructions are emitted when branch-protection is specified. -// min-llvm-version: 10.0.1 // assembly-output: emit-asm // compile-flags: --target aarch64-unknown-linux-gnu // compile-flags: -Z branch-protection=pac-ret,leaf diff --git a/src/test/assembly/asm/aarch64-types.rs b/src/test/assembly/asm/aarch64-types.rs index 04b5f4aed..66c39a48c 100644 --- a/src/test/assembly/asm/aarch64-types.rs +++ b/src/test/assembly/asm/aarch64-types.rs @@ -2,7 +2,7 @@ // compile-flags: --target aarch64-unknown-linux-gnu // needs-llvm-components: aarch64 -#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_sym)] +#![feature(no_core, lang_items, rustc_attrs, repr_simd)] #![crate_type = "rlib"] #![no_core] #![allow(asm_sub_register, non_camel_case_types)] diff --git a/src/test/assembly/asm/arm-types.rs b/src/test/assembly/asm/arm-types.rs index 5ac1af6af..b22a26ce3 100644 --- a/src/test/assembly/asm/arm-types.rs +++ b/src/test/assembly/asm/arm-types.rs @@ -3,7 +3,7 @@ // compile-flags: -C target-feature=+neon // needs-llvm-components: arm -#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_sym)] +#![feature(no_core, lang_items, rustc_attrs, repr_simd)] #![crate_type = "rlib"] #![no_core] #![allow(asm_sub_register, non_camel_case_types)] diff --git a/src/test/assembly/asm/avr-modifiers.rs b/src/test/assembly/asm/avr-modifiers.rs index aba4c982c..ffdc8f2e3 100644 --- a/src/test/assembly/asm/avr-modifiers.rs +++ b/src/test/assembly/asm/avr-modifiers.rs @@ -1,4 +1,3 @@ -// min-llvm-version: 13.0 // assembly-output: emit-asm // compile-flags: --target avr-unknown-gnu-atmega328 // needs-llvm-components: avr diff --git a/src/test/assembly/asm/avr-types.rs b/src/test/assembly/asm/avr-types.rs index 53a601e51..b2d11a882 100644 --- a/src/test/assembly/asm/avr-types.rs +++ b/src/test/assembly/asm/avr-types.rs @@ -1,9 +1,8 @@ -// min-llvm-version: 13.0 // assembly-output: emit-asm // compile-flags: --target avr-unknown-gnu-atmega328 // needs-llvm-components: avr -#![feature(no_core, lang_items, rustc_attrs, asm_sym, asm_experimental_arch)] +#![feature(no_core, lang_items, rustc_attrs, asm_experimental_arch)] #![crate_type = "rlib"] #![no_core] #![allow(non_camel_case_types)] diff --git a/src/test/assembly/asm/bpf-types.rs b/src/test/assembly/asm/bpf-types.rs index 3428d93fb..e177b8d0d 100644 --- a/src/test/assembly/asm/bpf-types.rs +++ b/src/test/assembly/asm/bpf-types.rs @@ -1,9 +1,8 @@ -// min-llvm-version: 13.0 // assembly-output: emit-asm // compile-flags: --target bpfel-unknown-none -C target_feature=+alu32 // needs-llvm-components: bpf -#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_sym, asm_experimental_arch)] +#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch)] #![crate_type = "rlib"] #![no_core] #![allow(asm_sub_register, non_camel_case_types)] diff --git a/src/test/assembly/asm/global_asm.rs b/src/test/assembly/asm/global_asm.rs index 4cf73b40f..0b361a7ed 100644 --- a/src/test/assembly/asm/global_asm.rs +++ b/src/test/assembly/asm/global_asm.rs @@ -4,7 +4,7 @@ // compile-flags: -C llvm-args=--x86-asm-syntax=intel // compile-flags: -C symbol-mangling-version=v0 -#![feature(asm_const, asm_sym)] +#![feature(asm_const)] #![crate_type = "rlib"] use std::arch::global_asm; @@ -28,4 +28,6 @@ global_asm!("lea rax, [rip + {}]", sym MY_STATIC); // CHECK: call _RNvCsiubXh4Yz005_10global_asm6foobar global_asm!("call {}", sym foobar); // CHECK: _RNvCsiubXh4Yz005_10global_asm6foobar: -fn foobar() { loop {} } +fn foobar() { + loop {} +} diff --git a/src/test/assembly/asm/hexagon-types.rs b/src/test/assembly/asm/hexagon-types.rs index eff9a0bb4..af16faedb 100644 --- a/src/test/assembly/asm/hexagon-types.rs +++ b/src/test/assembly/asm/hexagon-types.rs @@ -2,7 +2,7 @@ // compile-flags: --target hexagon-unknown-linux-musl // needs-llvm-components: hexagon -#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_sym, asm_experimental_arch)] +#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch)] #![crate_type = "rlib"] #![no_core] #![allow(asm_sub_register, non_camel_case_types)] diff --git a/src/test/assembly/asm/mips-types.rs b/src/test/assembly/asm/mips-types.rs index 04bf49a40..6aa28b062 100644 --- a/src/test/assembly/asm/mips-types.rs +++ b/src/test/assembly/asm/mips-types.rs @@ -5,7 +5,7 @@ //[mips64] compile-flags: --target mips64-unknown-linux-gnuabi64 //[mips64] needs-llvm-components: mips -#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_sym, asm_experimental_arch)] +#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch)] #![crate_type = "rlib"] #![no_core] #![allow(asm_sub_register, non_camel_case_types)] diff --git a/src/test/assembly/asm/msp430-types.rs b/src/test/assembly/asm/msp430-types.rs index 6cfb86e27..2c73b3b09 100644 --- a/src/test/assembly/asm/msp430-types.rs +++ b/src/test/assembly/asm/msp430-types.rs @@ -1,9 +1,8 @@ -// min-llvm-version: 13.0 // assembly-output: emit-asm // compile-flags: --target msp430-none-elf // needs-llvm-components: msp430 -#![feature(no_core, lang_items, rustc_attrs, asm_sym, asm_experimental_arch, asm_const)] +#![feature(no_core, lang_items, rustc_attrs, asm_experimental_arch, asm_const)] #![crate_type = "rlib"] #![no_core] #![allow(non_camel_case_types)] diff --git a/src/test/assembly/asm/nvptx-types.rs b/src/test/assembly/asm/nvptx-types.rs index 3ebd5b4b8..c319946b5 100644 --- a/src/test/assembly/asm/nvptx-types.rs +++ b/src/test/assembly/asm/nvptx-types.rs @@ -3,7 +3,7 @@ // compile-flags: --crate-type cdylib // needs-llvm-components: nvptx -#![feature(no_core, lang_items, rustc_attrs, asm_sym, asm_experimental_arch)] +#![feature(no_core, lang_items, rustc_attrs, asm_experimental_arch)] #![no_core] #[rustc_builtin_macro] diff --git a/src/test/assembly/asm/powerpc-types.rs b/src/test/assembly/asm/powerpc-types.rs index b8859c07e..e27b00520 100644 --- a/src/test/assembly/asm/powerpc-types.rs +++ b/src/test/assembly/asm/powerpc-types.rs @@ -1,4 +1,3 @@ -// min-llvm-version: 12.0.1 // revisions: powerpc powerpc64 // assembly-output: emit-asm //[powerpc] compile-flags: --target powerpc-unknown-linux-gnu @@ -6,7 +5,7 @@ //[powerpc64] compile-flags: --target powerpc64-unknown-linux-gnu //[powerpc64] needs-llvm-components: powerpc -#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_sym, asm_experimental_arch)] +#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch)] #![crate_type = "rlib"] #![no_core] #![allow(asm_sub_register, non_camel_case_types)] diff --git a/src/test/assembly/asm/riscv-types.rs b/src/test/assembly/asm/riscv-types.rs index 68dc186ea..f18ba294d 100644 --- a/src/test/assembly/asm/riscv-types.rs +++ b/src/test/assembly/asm/riscv-types.rs @@ -6,7 +6,7 @@ //[riscv32] needs-llvm-components: riscv // compile-flags: -C target-feature=+d -#![feature(no_core, lang_items, rustc_attrs, asm_sym)] +#![feature(no_core, lang_items, rustc_attrs)] #![crate_type = "rlib"] #![no_core] #![allow(asm_sub_register)] diff --git a/src/test/assembly/asm/s390x-types.rs b/src/test/assembly/asm/s390x-types.rs index 6a12902a0..2fb404dd9 100644 --- a/src/test/assembly/asm/s390x-types.rs +++ b/src/test/assembly/asm/s390x-types.rs @@ -3,7 +3,7 @@ //[s390x] compile-flags: --target s390x-unknown-linux-gnu //[s390x] needs-llvm-components: systemz -#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_sym, asm_experimental_arch)] +#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch)] #![crate_type = "rlib"] #![no_core] #![allow(asm_sub_register, non_camel_case_types)] diff --git a/src/test/assembly/asm/wasm-types.rs b/src/test/assembly/asm/wasm-types.rs index 3aa128c46..3b1ac1b45 100644 --- a/src/test/assembly/asm/wasm-types.rs +++ b/src/test/assembly/asm/wasm-types.rs @@ -3,7 +3,7 @@ // compile-flags: --crate-type cdylib // needs-llvm-components: webassembly -#![feature(no_core, lang_items, rustc_attrs, asm_sym, asm_experimental_arch)] +#![feature(no_core, lang_items, rustc_attrs, asm_experimental_arch)] #![no_core] #[rustc_builtin_macro] diff --git a/src/test/assembly/asm/x86-types.rs b/src/test/assembly/asm/x86-types.rs index e871535cf..81be79cba 100644 --- a/src/test/assembly/asm/x86-types.rs +++ b/src/test/assembly/asm/x86-types.rs @@ -7,7 +7,7 @@ // compile-flags: -C llvm-args=--x86-asm-syntax=intel // compile-flags: -C target-feature=+avx512bw -#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_sym)] +#![feature(no_core, lang_items, rustc_attrs, repr_simd)] #![crate_type = "rlib"] #![no_core] #![allow(asm_sub_register, non_camel_case_types)] diff --git a/src/test/assembly/stack-protector/stack-protector-target-support.rs b/src/test/assembly/stack-protector/stack-protector-target-support.rs index 5ba46d082..2fb62e93e 100644 --- a/src/test/assembly/stack-protector/stack-protector-target-support.rs +++ b/src/test/assembly/stack-protector/stack-protector-target-support.rs @@ -156,7 +156,6 @@ // [r74] needs-llvm-components: x86 // [r75] compile-flags:--target x86_64-fortanix-unknown-sgx // [r75] needs-llvm-components: x86 -// [r75] min-llvm-version: 11.0.0 // [r76] compile-flags:--target x86_64-fuchsia // [r76] needs-llvm-components: x86 // [r77] compile-flags:--target x86_64-linux-android diff --git a/src/test/assembly/x86-stack-probes.rs b/src/test/assembly/x86-stack-probes.rs new file mode 100644 index 000000000..c7141fb20 --- /dev/null +++ b/src/test/assembly/x86-stack-probes.rs @@ -0,0 +1,42 @@ +// min-llvm-version: 16 +// revisions: x86_64 i686 +// assembly-output: emit-asm +//[x86_64] compile-flags: --target x86_64-unknown-linux-gnu +//[x86_64] needs-llvm-components: x86 +//[i686] compile-flags: --target i686-unknown-linux-gnu +//[i686] needs-llvm-components: x86 +// compile-flags: -C llvm-args=-x86-asm-syntax=intel + +#![feature(no_core, lang_items)] +#![crate_type = "lib"] +#![no_core] + +#[lang = "sized"] +trait Sized {} +#[lang = "copy"] +trait Copy {} + +impl Copy for u8 {} + +// Check that inline-asm stack probes are generated correctly. +// To avoid making this test fragile to slight asm changes, +// we only check that the stack pointer is decremented by a page at a time, +// instead of matching the whole probe sequence. + +// CHECK-LABEL: small_stack_probe: +#[no_mangle] +pub fn small_stack_probe(x: u8, f: fn(&mut [u8; 8192])) { + // CHECK-NOT: __rust_probestack + // x86_64: sub rsp, 4096 + // i686: sub esp, 4096 + f(&mut [x; 8192]); +} + +// CHECK-LABEL: big_stack_probe: +#[no_mangle] +pub fn big_stack_probe(x: u8, f: fn(&[u8; 65536])) { + // CHECK-NOT: __rust_probestack + // x86_64: sub rsp, 4096 + // i686: sub esp, 4096 + f(&mut [x; 65536]); +} diff --git a/src/test/assembly/x86_64-floating-point-clamp.rs b/src/test/assembly/x86_64-floating-point-clamp.rs new file mode 100644 index 000000000..0f3b465d0 --- /dev/null +++ b/src/test/assembly/x86_64-floating-point-clamp.rs @@ -0,0 +1,25 @@ +// Floating-point clamp is designed to be implementable as max+min, +// so check to make sure that's what it's actually emitting. + +// assembly-output: emit-asm +// compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel +// only-x86_64 + +// CHECK-LABEL: clamp_demo: +#[no_mangle] +pub fn clamp_demo(a: f32, x: f32, y: f32) -> f32 { + // CHECK: maxss + // CHECK: minss + a.clamp(x, y) +} + +// CHECK-LABEL: clamp12_demo: +#[no_mangle] +pub fn clamp12_demo(a: f32) -> f32 { + // CHECK: movss xmm1 + // CHECK-NEXT: maxss xmm1, xmm0 + // CHECK-NEXT: movss xmm0 + // CHECK-NEXT: minss xmm0, xmm1 + // CHECK: ret + a.clamp(1.0, 2.0) +} |