From 06711615aa5b3d45e77c1aa20df7de14ed16edf2 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sat, 29 Jul 2023 17:07:57 -0700 Subject: [PATCH 1/7] tests/codegen/enum-* -> enum/enum-* --- tests/codegen/{ => enum}/enum-bounds-check-derived-idx.rs | 0 tests/codegen/{ => enum}/enum-bounds-check-issue-13926.rs | 0 tests/codegen/{ => enum}/enum-bounds-check-issue-82871.rs | 0 tests/codegen/{ => enum}/enum-bounds-check.rs | 0 tests/codegen/{ => enum}/enum-debug-clike.rs | 0 tests/codegen/{ => enum}/enum-debug-niche-2.rs | 0 tests/codegen/{ => enum}/enum-debug-niche.rs | 0 tests/codegen/{ => enum}/enum-debug-tagged.rs | 0 tests/codegen/{ => enum}/enum-discriminant-value.rs | 0 tests/codegen/{ => enum}/enum-match.rs | 0 tests/codegen/{ => enum}/enum-u128.rs | 0 11 files changed, 0 insertions(+), 0 deletions(-) rename tests/codegen/{ => enum}/enum-bounds-check-derived-idx.rs (100%) rename tests/codegen/{ => enum}/enum-bounds-check-issue-13926.rs (100%) rename tests/codegen/{ => enum}/enum-bounds-check-issue-82871.rs (100%) rename tests/codegen/{ => enum}/enum-bounds-check.rs (100%) rename tests/codegen/{ => enum}/enum-debug-clike.rs (100%) rename tests/codegen/{ => enum}/enum-debug-niche-2.rs (100%) rename tests/codegen/{ => enum}/enum-debug-niche.rs (100%) rename tests/codegen/{ => enum}/enum-debug-tagged.rs (100%) rename tests/codegen/{ => enum}/enum-discriminant-value.rs (100%) rename tests/codegen/{ => enum}/enum-match.rs (100%) rename tests/codegen/{ => enum}/enum-u128.rs (100%) diff --git a/tests/codegen/enum-bounds-check-derived-idx.rs b/tests/codegen/enum/enum-bounds-check-derived-idx.rs similarity index 100% rename from tests/codegen/enum-bounds-check-derived-idx.rs rename to tests/codegen/enum/enum-bounds-check-derived-idx.rs diff --git a/tests/codegen/enum-bounds-check-issue-13926.rs b/tests/codegen/enum/enum-bounds-check-issue-13926.rs similarity index 100% rename from tests/codegen/enum-bounds-check-issue-13926.rs rename to tests/codegen/enum/enum-bounds-check-issue-13926.rs diff --git a/tests/codegen/enum-bounds-check-issue-82871.rs b/tests/codegen/enum/enum-bounds-check-issue-82871.rs similarity index 100% rename from tests/codegen/enum-bounds-check-issue-82871.rs rename to tests/codegen/enum/enum-bounds-check-issue-82871.rs diff --git a/tests/codegen/enum-bounds-check.rs b/tests/codegen/enum/enum-bounds-check.rs similarity index 100% rename from tests/codegen/enum-bounds-check.rs rename to tests/codegen/enum/enum-bounds-check.rs diff --git a/tests/codegen/enum-debug-clike.rs b/tests/codegen/enum/enum-debug-clike.rs similarity index 100% rename from tests/codegen/enum-debug-clike.rs rename to tests/codegen/enum/enum-debug-clike.rs diff --git a/tests/codegen/enum-debug-niche-2.rs b/tests/codegen/enum/enum-debug-niche-2.rs similarity index 100% rename from tests/codegen/enum-debug-niche-2.rs rename to tests/codegen/enum/enum-debug-niche-2.rs diff --git a/tests/codegen/enum-debug-niche.rs b/tests/codegen/enum/enum-debug-niche.rs similarity index 100% rename from tests/codegen/enum-debug-niche.rs rename to tests/codegen/enum/enum-debug-niche.rs diff --git a/tests/codegen/enum-debug-tagged.rs b/tests/codegen/enum/enum-debug-tagged.rs similarity index 100% rename from tests/codegen/enum-debug-tagged.rs rename to tests/codegen/enum/enum-debug-tagged.rs diff --git a/tests/codegen/enum-discriminant-value.rs b/tests/codegen/enum/enum-discriminant-value.rs similarity index 100% rename from tests/codegen/enum-discriminant-value.rs rename to tests/codegen/enum/enum-discriminant-value.rs diff --git a/tests/codegen/enum-match.rs b/tests/codegen/enum/enum-match.rs similarity index 100% rename from tests/codegen/enum-match.rs rename to tests/codegen/enum/enum-match.rs diff --git a/tests/codegen/enum-u128.rs b/tests/codegen/enum/enum-u128.rs similarity index 100% rename from tests/codegen/enum-u128.rs rename to tests/codegen/enum/enum-u128.rs From df2264a2845089fee6897e17123d2b78a3a189c1 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sat, 29 Jul 2023 17:09:31 -0700 Subject: [PATCH 2/7] tests/codegen/*-macos-* -> macos/* --- tests/codegen/{ => macos}/i686-macosx-deployment-target.rs | 0 tests/codegen/{ => macos}/i686-no-macosx-deployment-target.rs | 0 tests/codegen/{ => macos}/x86_64-macosx-deployment-target.rs | 0 tests/codegen/{ => macos}/x86_64-no-macosx-deployment-target.rs | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename tests/codegen/{ => macos}/i686-macosx-deployment-target.rs (100%) rename tests/codegen/{ => macos}/i686-no-macosx-deployment-target.rs (100%) rename tests/codegen/{ => macos}/x86_64-macosx-deployment-target.rs (100%) rename tests/codegen/{ => macos}/x86_64-no-macosx-deployment-target.rs (100%) diff --git a/tests/codegen/i686-macosx-deployment-target.rs b/tests/codegen/macos/i686-macosx-deployment-target.rs similarity index 100% rename from tests/codegen/i686-macosx-deployment-target.rs rename to tests/codegen/macos/i686-macosx-deployment-target.rs diff --git a/tests/codegen/i686-no-macosx-deployment-target.rs b/tests/codegen/macos/i686-no-macosx-deployment-target.rs similarity index 100% rename from tests/codegen/i686-no-macosx-deployment-target.rs rename to tests/codegen/macos/i686-no-macosx-deployment-target.rs diff --git a/tests/codegen/x86_64-macosx-deployment-target.rs b/tests/codegen/macos/x86_64-macosx-deployment-target.rs similarity index 100% rename from tests/codegen/x86_64-macosx-deployment-target.rs rename to tests/codegen/macos/x86_64-macosx-deployment-target.rs diff --git a/tests/codegen/x86_64-no-macosx-deployment-target.rs b/tests/codegen/macos/x86_64-no-macosx-deployment-target.rs similarity index 100% rename from tests/codegen/x86_64-no-macosx-deployment-target.rs rename to tests/codegen/macos/x86_64-no-macosx-deployment-target.rs From 45c284cd98b1b3905e4e54bbc5c40080424425b5 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sat, 29 Jul 2023 17:11:38 -0700 Subject: [PATCH 3/7] tests/codegen/*simd*.rs -> simd/*simd* --- tests/codegen/{ => simd}/simd-wide-sum.rs | 0 tests/codegen/{ => simd}/simd_arith_offset.rs | 0 tests/codegen/{ => simd}/swap-simd-types.rs | 0 tests/codegen/{ => simd}/unpadded-simd.rs | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename tests/codegen/{ => simd}/simd-wide-sum.rs (100%) rename tests/codegen/{ => simd}/simd_arith_offset.rs (100%) rename tests/codegen/{ => simd}/swap-simd-types.rs (100%) rename tests/codegen/{ => simd}/unpadded-simd.rs (100%) diff --git a/tests/codegen/simd-wide-sum.rs b/tests/codegen/simd/simd-wide-sum.rs similarity index 100% rename from tests/codegen/simd-wide-sum.rs rename to tests/codegen/simd/simd-wide-sum.rs diff --git a/tests/codegen/simd_arith_offset.rs b/tests/codegen/simd/simd_arith_offset.rs similarity index 100% rename from tests/codegen/simd_arith_offset.rs rename to tests/codegen/simd/simd_arith_offset.rs diff --git a/tests/codegen/swap-simd-types.rs b/tests/codegen/simd/swap-simd-types.rs similarity index 100% rename from tests/codegen/swap-simd-types.rs rename to tests/codegen/simd/swap-simd-types.rs diff --git a/tests/codegen/unpadded-simd.rs b/tests/codegen/simd/unpadded-simd.rs similarity index 100% rename from tests/codegen/unpadded-simd.rs rename to tests/codegen/simd/unpadded-simd.rs From 0ca0556651f304af3893742ebd6e543648ca1e67 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sat, 29 Jul 2023 17:28:01 -0700 Subject: [PATCH 4/7] tests/codegen/naked-* -> naked-fn/naked-* --- tests/codegen/{ => naked-fn}/naked-functions.rs | 0 tests/codegen/{ => naked-fn}/naked-nocoverage.rs | 0 tests/codegen/{ => naked-fn}/naked-noinline.rs | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename tests/codegen/{ => naked-fn}/naked-functions.rs (100%) rename tests/codegen/{ => naked-fn}/naked-nocoverage.rs (100%) rename tests/codegen/{ => naked-fn}/naked-noinline.rs (100%) diff --git a/tests/codegen/naked-functions.rs b/tests/codegen/naked-fn/naked-functions.rs similarity index 100% rename from tests/codegen/naked-functions.rs rename to tests/codegen/naked-fn/naked-functions.rs diff --git a/tests/codegen/naked-nocoverage.rs b/tests/codegen/naked-fn/naked-nocoverage.rs similarity index 100% rename from tests/codegen/naked-nocoverage.rs rename to tests/codegen/naked-fn/naked-nocoverage.rs diff --git a/tests/codegen/naked-noinline.rs b/tests/codegen/naked-fn/naked-noinline.rs similarity index 100% rename from tests/codegen/naked-noinline.rs rename to tests/codegen/naked-fn/naked-noinline.rs From badba92036e9728a499e118e7a6646fffd33d098 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sat, 29 Jul 2023 17:28:42 -0700 Subject: [PATCH 5/7] tests/codegen/ffi-* -> cffi/ffi-* --- tests/codegen/{ => cffi}/ffi-const.rs | 0 tests/codegen/{ => cffi}/ffi-out-of-bounds-loads.rs | 0 tests/codegen/{ => cffi}/ffi-pure.rs | 0 tests/codegen/{ => cffi}/ffi-returns-twice.rs | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename tests/codegen/{ => cffi}/ffi-const.rs (100%) rename tests/codegen/{ => cffi}/ffi-out-of-bounds-loads.rs (100%) rename tests/codegen/{ => cffi}/ffi-pure.rs (100%) rename tests/codegen/{ => cffi}/ffi-returns-twice.rs (100%) diff --git a/tests/codegen/ffi-const.rs b/tests/codegen/cffi/ffi-const.rs similarity index 100% rename from tests/codegen/ffi-const.rs rename to tests/codegen/cffi/ffi-const.rs diff --git a/tests/codegen/ffi-out-of-bounds-loads.rs b/tests/codegen/cffi/ffi-out-of-bounds-loads.rs similarity index 100% rename from tests/codegen/ffi-out-of-bounds-loads.rs rename to tests/codegen/cffi/ffi-out-of-bounds-loads.rs diff --git a/tests/codegen/ffi-pure.rs b/tests/codegen/cffi/ffi-pure.rs similarity index 100% rename from tests/codegen/ffi-pure.rs rename to tests/codegen/cffi/ffi-pure.rs diff --git a/tests/codegen/ffi-returns-twice.rs b/tests/codegen/cffi/ffi-returns-twice.rs similarity index 100% rename from tests/codegen/ffi-returns-twice.rs rename to tests/codegen/cffi/ffi-returns-twice.rs From f03b31591c65b8fb43537cca83fbd306f24f413d Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sat, 29 Jul 2023 17:30:35 -0700 Subject: [PATCH 6/7] tests/codegen/c-variadic* -> cffi/c-variadic* --- tests/codegen/{ => cffi}/c-variadic-copy.rs | 0 tests/codegen/{ => cffi}/c-variadic-opt.rs | 0 tests/codegen/{ => cffi}/c-variadic.rs | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename tests/codegen/{ => cffi}/c-variadic-copy.rs (100%) rename tests/codegen/{ => cffi}/c-variadic-opt.rs (100%) rename tests/codegen/{ => cffi}/c-variadic.rs (100%) diff --git a/tests/codegen/c-variadic-copy.rs b/tests/codegen/cffi/c-variadic-copy.rs similarity index 100% rename from tests/codegen/c-variadic-copy.rs rename to tests/codegen/cffi/c-variadic-copy.rs diff --git a/tests/codegen/c-variadic-opt.rs b/tests/codegen/cffi/c-variadic-opt.rs similarity index 100% rename from tests/codegen/c-variadic-opt.rs rename to tests/codegen/cffi/c-variadic-opt.rs diff --git a/tests/codegen/c-variadic.rs b/tests/codegen/cffi/c-variadic.rs similarity index 100% rename from tests/codegen/c-variadic.rs rename to tests/codegen/cffi/c-variadic.rs From c81d3e23d1aa58571ce82de0af916cc7f3c9a1be Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sat, 29 Jul 2023 17:37:09 -0700 Subject: [PATCH 7/7] Remove LLVM 14 codegen tests We raised our LLVM minimum to 15, so these tests seem pointless. --- tests/codegen/box-maybe-uninit-llvm14.rs | 34 ------ tests/codegen/vec-calloc-llvm14.rs | 144 ----------------------- 2 files changed, 178 deletions(-) delete mode 100644 tests/codegen/box-maybe-uninit-llvm14.rs delete mode 100644 tests/codegen/vec-calloc-llvm14.rs diff --git a/tests/codegen/box-maybe-uninit-llvm14.rs b/tests/codegen/box-maybe-uninit-llvm14.rs deleted file mode 100644 index c9f88fb3fe452..0000000000000 --- a/tests/codegen/box-maybe-uninit-llvm14.rs +++ /dev/null @@ -1,34 +0,0 @@ -// compile-flags: -O - -// Once we're done with llvm 14 and earlier, this test can be deleted. - -#![crate_type = "lib"] - -use std::mem::MaybeUninit; - -// Boxing a `MaybeUninit` value should not copy junk from the stack -#[no_mangle] -pub fn box_uninitialized() -> Box> { - // CHECK-LABEL: @box_uninitialized - // CHECK-NOT: store - // CHECK-NOT: alloca - // CHECK-NOT: memcpy - // CHECK-NOT: memset - Box::new(MaybeUninit::uninit()) -} - -// https://github.com/rust-lang/rust/issues/58201 -#[no_mangle] -pub fn box_uninitialized2() -> Box> { - // CHECK-LABEL: @box_uninitialized2 - // CHECK-NOT: store - // CHECK-NOT: alloca - // CHECK-NOT: memcpy - // CHECK-NOT: memset - Box::new(MaybeUninit::uninit()) -} - -// Hide the LLVM 15+ `allocalign` attribute in the declaration of __rust_alloc -// from the CHECK-NOT above. We don't check the attributes here because we can't rely -// on all of them being set until LLVM 15. -// CHECK: declare {{(dso_local )?}}noalias{{.*}} @__rust_alloc(i{{[0-9]+}} noundef, i{{[0-9]+.*}} noundef) diff --git a/tests/codegen/vec-calloc-llvm14.rs b/tests/codegen/vec-calloc-llvm14.rs deleted file mode 100644 index 08302796c41a1..0000000000000 --- a/tests/codegen/vec-calloc-llvm14.rs +++ /dev/null @@ -1,144 +0,0 @@ -// compile-flags: -O -// only-x86_64 -// ignore-debug - -#![crate_type = "lib"] - -// CHECK-LABEL: @vec_zero_bytes -#[no_mangle] -pub fn vec_zero_bytes(n: usize) -> Vec { - // CHECK-NOT: call {{.*}}alloc::vec::from_elem - // CHECK-NOT: call {{.*}}reserve - // CHECK-NOT: call {{.*}}__rust_alloc( - // CHECK-NOT: call {{.*}}llvm.memset - - // CHECK: call {{.*}}__rust_alloc_zeroed( - - // CHECK-NOT: call {{.*}}alloc::vec::from_elem - // CHECK-NOT: call {{.*}}reserve - // CHECK-NOT: call {{.*}}__rust_alloc( - // CHECK-NOT: call {{.*}}llvm.memset - - // CHECK: ret void - vec![0; n] -} - -// CHECK-LABEL: @vec_one_bytes -#[no_mangle] -pub fn vec_one_bytes(n: usize) -> Vec { - // CHECK-NOT: call {{.*}}alloc::vec::from_elem - // CHECK-NOT: call {{.*}}reserve - // CHECK-NOT: call {{.*}}__rust_alloc_zeroed( - - // CHECK: call {{.*}}__rust_alloc( - // CHECK: call {{.*}}llvm.memset - - // CHECK-NOT: call {{.*}}alloc::vec::from_elem - // CHECK-NOT: call {{.*}}reserve - // CHECK-NOT: call {{.*}}__rust_alloc_zeroed( - - // CHECK: ret void - vec![1; n] -} - -// CHECK-LABEL: @vec_zero_scalar -#[no_mangle] -pub fn vec_zero_scalar(n: usize) -> Vec { - // CHECK-NOT: call {{.*}}alloc::vec::from_elem - // CHECK-NOT: call {{.*}}reserve - // CHECK-NOT: call {{.*}}__rust_alloc( - - // CHECK: call {{.*}}__rust_alloc_zeroed( - - // CHECK-NOT: call {{.*}}alloc::vec::from_elem - // CHECK-NOT: call {{.*}}reserve - // CHECK-NOT: call {{.*}}__rust_alloc( - - // CHECK: ret void - vec![0; n] -} - -// CHECK-LABEL: @vec_one_scalar -#[no_mangle] -pub fn vec_one_scalar(n: usize) -> Vec { - // CHECK-NOT: call {{.*}}alloc::vec::from_elem - // CHECK-NOT: call {{.*}}reserve - // CHECK-NOT: call {{.*}}__rust_alloc_zeroed( - - // CHECK: call {{.*}}__rust_alloc( - - // CHECK-NOT: call {{.*}}alloc::vec::from_elem - // CHECK-NOT: call {{.*}}reserve - // CHECK-NOT: call {{.*}}__rust_alloc_zeroed( - - // CHECK: ret void - vec![1; n] -} - -// CHECK-LABEL: @vec_zero_rgb48 -#[no_mangle] -pub fn vec_zero_rgb48(n: usize) -> Vec<[u16; 3]> { - // CHECK-NOT: call {{.*}}alloc::vec::from_elem - // CHECK-NOT: call {{.*}}reserve - // CHECK-NOT: call {{.*}}__rust_alloc( - - // CHECK: call {{.*}}__rust_alloc_zeroed( - - // CHECK-NOT: call {{.*}}alloc::vec::from_elem - // CHECK-NOT: call {{.*}}reserve - // CHECK-NOT: call {{.*}}__rust_alloc( - - // CHECK: ret void - vec![[0, 0, 0]; n] -} - -// CHECK-LABEL: @vec_zero_array_16 -#[no_mangle] -pub fn vec_zero_array_16(n: usize) -> Vec<[i64; 16]> { - // CHECK-NOT: call {{.*}}alloc::vec::from_elem - // CHECK-NOT: call {{.*}}reserve - // CHECK-NOT: call {{.*}}__rust_alloc( - - // CHECK: call {{.*}}__rust_alloc_zeroed( - - // CHECK-NOT: call {{.*}}alloc::vec::from_elem - // CHECK-NOT: call {{.*}}reserve - // CHECK-NOT: call {{.*}}__rust_alloc( - - // CHECK: ret void - vec![[0_i64; 16]; n] -} - -// CHECK-LABEL: @vec_zero_tuple -#[no_mangle] -pub fn vec_zero_tuple(n: usize) -> Vec<(i16, u8, char)> { - // CHECK-NOT: call {{.*}}alloc::vec::from_elem - // CHECK-NOT: call {{.*}}reserve - // CHECK-NOT: call {{.*}}__rust_alloc( - - // CHECK: call {{.*}}__rust_alloc_zeroed( - - // CHECK-NOT: call {{.*}}alloc::vec::from_elem - // CHECK-NOT: call {{.*}}reserve - // CHECK-NOT: call {{.*}}__rust_alloc( - - // CHECK: ret void - vec![(0, 0, '\0'); n] -} - -// CHECK-LABEL: @vec_non_zero_tuple -#[no_mangle] -pub fn vec_non_zero_tuple(n: usize) -> Vec<(i16, u8, char)> { - // CHECK-NOT: call {{.*}}alloc::vec::from_elem - // CHECK-NOT: call {{.*}}reserve - // CHECK-NOT: call {{.*}}__rust_alloc_zeroed( - - // CHECK: call {{.*}}__rust_alloc( - - // CHECK-NOT: call {{.*}}alloc::vec::from_elem - // CHECK-NOT: call {{.*}}reserve - // CHECK-NOT: call {{.*}}__rust_alloc_zeroed( - - // CHECK: ret void - vec![(0, 0, 'A'); n] -}