From 1376c5a617be5c25655d0d7cb63e3beaa5a6e026 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:20:39 +0200 Subject: Merging upstream version 1.70.0+dfsg1. Signed-off-by: Daniel Baumann --- tests/run-make-fulldeps/atomic-lock-free/Makefile | 48 ---------------- .../atomic-lock-free/atomic_lock_free.rs | 66 ---------------------- 2 files changed, 114 deletions(-) delete mode 100644 tests/run-make-fulldeps/atomic-lock-free/Makefile delete mode 100644 tests/run-make-fulldeps/atomic-lock-free/atomic_lock_free.rs (limited to 'tests/run-make-fulldeps/atomic-lock-free') diff --git a/tests/run-make-fulldeps/atomic-lock-free/Makefile b/tests/run-make-fulldeps/atomic-lock-free/Makefile deleted file mode 100644 index 37e59624a..000000000 --- a/tests/run-make-fulldeps/atomic-lock-free/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -include ../tools.mk - -# This tests ensure that atomic types are never lowered into runtime library calls that are not -# guaranteed to be lock-free. - -all: -ifeq ($(UNAME),Linux) -ifeq ($(filter x86,$(LLVM_COMPONENTS)),x86) - $(RUSTC) --target=i686-unknown-linux-gnu atomic_lock_free.rs - nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add - $(RUSTC) --target=x86_64-unknown-linux-gnu atomic_lock_free.rs - nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add -endif -ifeq ($(filter arm,$(LLVM_COMPONENTS)),arm) - $(RUSTC) --target=arm-unknown-linux-gnueabi atomic_lock_free.rs - nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add - $(RUSTC) --target=arm-unknown-linux-gnueabihf atomic_lock_free.rs - nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add - $(RUSTC) --target=armv7-unknown-linux-gnueabihf atomic_lock_free.rs - nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add - $(RUSTC) --target=thumbv7neon-unknown-linux-gnueabihf atomic_lock_free.rs - nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add -endif -ifeq ($(filter aarch64,$(LLVM_COMPONENTS)),aarch64) - $(RUSTC) --target=aarch64-unknown-linux-gnu atomic_lock_free.rs - nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add -endif -ifeq ($(filter mips,$(LLVM_COMPONENTS)),mips) - $(RUSTC) --target=mips-unknown-linux-gnu atomic_lock_free.rs - nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add - $(RUSTC) --target=mipsel-unknown-linux-gnu atomic_lock_free.rs - nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add -endif -ifeq ($(filter powerpc,$(LLVM_COMPONENTS)),powerpc) - $(RUSTC) --target=powerpc-unknown-linux-gnu atomic_lock_free.rs - nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add - $(RUSTC) --target=powerpc-unknown-linux-gnuspe atomic_lock_free.rs - nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add - $(RUSTC) --target=powerpc64-unknown-linux-gnu atomic_lock_free.rs - nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add - $(RUSTC) --target=powerpc64le-unknown-linux-gnu atomic_lock_free.rs - nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add -endif -ifeq ($(filter systemz,$(LLVM_COMPONENTS)),systemz) - $(RUSTC) --target=s390x-unknown-linux-gnu atomic_lock_free.rs - nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add -endif -endif diff --git a/tests/run-make-fulldeps/atomic-lock-free/atomic_lock_free.rs b/tests/run-make-fulldeps/atomic-lock-free/atomic_lock_free.rs deleted file mode 100644 index 47d90b185..000000000 --- a/tests/run-make-fulldeps/atomic-lock-free/atomic_lock_free.rs +++ /dev/null @@ -1,66 +0,0 @@ -#![feature(no_core, intrinsics, lang_items)] -#![crate_type="rlib"] -#![no_core] - -extern "rust-intrinsic" { - fn atomic_xadd_seqcst(dst: *mut T, src: T) -> T; -} - -#[lang = "sized"] -trait Sized {} -#[lang = "copy"] -trait Copy {} -#[lang = "freeze"] -trait Freeze {} - -impl Copy for *mut T {} - -#[cfg(target_has_atomic = "8")] -pub unsafe fn atomic_u8(x: *mut u8) { - atomic_xadd_seqcst(x, 1); - atomic_xadd_seqcst(x, 1); -} -#[cfg(target_has_atomic = "8")] -pub unsafe fn atomic_i8(x: *mut i8) { - atomic_xadd_seqcst(x, 1); -} -#[cfg(target_has_atomic = "16")] -pub unsafe fn atomic_u16(x: *mut u16) { - atomic_xadd_seqcst(x, 1); -} -#[cfg(target_has_atomic = "16")] -pub unsafe fn atomic_i16(x: *mut i16) { - atomic_xadd_seqcst(x, 1); -} -#[cfg(target_has_atomic = "32")] -pub unsafe fn atomic_u32(x: *mut u32) { - atomic_xadd_seqcst(x, 1); -} -#[cfg(target_has_atomic = "32")] -pub unsafe fn atomic_i32(x: *mut i32) { - atomic_xadd_seqcst(x, 1); -} -#[cfg(target_has_atomic = "64")] -pub unsafe fn atomic_u64(x: *mut u64) { - atomic_xadd_seqcst(x, 1); -} -#[cfg(target_has_atomic = "64")] -pub unsafe fn atomic_i64(x: *mut i64) { - atomic_xadd_seqcst(x, 1); -} -#[cfg(target_has_atomic = "128")] -pub unsafe fn atomic_u128(x: *mut u128) { - atomic_xadd_seqcst(x, 1); -} -#[cfg(target_has_atomic = "128")] -pub unsafe fn atomic_i128(x: *mut i128) { - atomic_xadd_seqcst(x, 1); -} -#[cfg(target_has_atomic = "ptr")] -pub unsafe fn atomic_usize(x: *mut usize) { - atomic_xadd_seqcst(x, 1); -} -#[cfg(target_has_atomic = "ptr")] -pub unsafe fn atomic_isize(x: *mut isize) { - atomic_xadd_seqcst(x, 1); -} -- cgit v1.2.3