summaryrefslogtreecommitdiffstats
path: root/tests/codegen
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
commit9918693037dce8aa4bb6f08741b6812923486c18 (patch)
tree21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /tests/codegen
parentReleasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff)
downloadrustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz
rustc-9918693037dce8aa4bb6f08741b6812923486c18.zip
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/codegen')
-rw-r--r--tests/codegen/ascii-char.rs2
-rw-r--r--tests/codegen/debug-accessibility/crate-enum.rs26
-rw-r--r--tests/codegen/debug-accessibility/crate-struct.rs23
-rw-r--r--tests/codegen/debug-accessibility/private-enum.rs21
-rw-r--r--tests/codegen/debug-accessibility/private-struct.rs17
-rw-r--r--tests/codegen/debug-accessibility/public-enum.rs21
-rw-r--r--tests/codegen/debug-accessibility/public-struct.rs17
-rw-r--r--tests/codegen/debug-accessibility/struct-fields.rs30
-rw-r--r--tests/codegen/debug-accessibility/super-enum.rs27
-rw-r--r--tests/codegen/debug-accessibility/super-struct.rs23
-rw-r--r--tests/codegen/debug-accessibility/tuple-fields.rs24
-rw-r--r--tests/codegen/default-hidden-visibility.rs31
-rw-r--r--tests/codegen/ehcontguard_disabled.rs10
-rw-r--r--tests/codegen/ehcontguard_enabled.rs10
-rw-r--r--tests/codegen/function-return.rs28
-rw-r--r--tests/codegen/issues/issue-101048.rs1
-rw-r--r--tests/codegen/issues/issue-101082.rs1
-rw-r--r--tests/codegen/issues/issue-101814.rs1
-rw-r--r--tests/codegen/issues/issue-103132.rs1
-rw-r--r--tests/codegen/issues/issue-103327.rs1
-rw-r--r--tests/codegen/issues/issue-103840.rs1
-rw-r--r--tests/codegen/issues/issue-116878.rs13
-rw-r--r--tests/codegen/issues/issue-75978.rs1
-rw-r--r--tests/codegen/issues/issue-86106.rs28
-rw-r--r--tests/codegen/issues/issue-99960.rs1
-rw-r--r--tests/codegen/llvm_module_flags.rs7
-rw-r--r--tests/codegen/overaligned-constant.rs36
-rw-r--r--tests/codegen/sanitizer/cfi-normalize-integers.rs77
-rw-r--r--tests/codegen/sanitizer/kasan-emits-instrumentation.rs2
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-load.rs34
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-store.rs32
-rw-r--r--tests/codegen/simd/simd-wide-sum.rs2
-rw-r--r--tests/codegen/slice-iter-fold.rs1
-rw-r--r--tests/codegen/stack-probes-call.rs24
-rw-r--r--tests/codegen/stack-probes-inline.rs6
-rw-r--r--tests/codegen/thin-lto.rs7
-rw-r--r--tests/codegen/unchecked_shifts.rs4
-rw-r--r--tests/codegen/vec-in-place.rs1
38 files changed, 484 insertions, 108 deletions
diff --git a/tests/codegen/ascii-char.rs b/tests/codegen/ascii-char.rs
index 4167becf5..711ffe7e1 100644
--- a/tests/codegen/ascii-char.rs
+++ b/tests/codegen/ascii-char.rs
@@ -14,7 +14,7 @@ pub fn unwrap_digit_from_remainder(v: u32) -> AsciiChar {
// CHECK: %[[R:.+]] = urem i32 %v, 10
// CHECK-NEXT: %[[T:.+]] = trunc i32 %[[R]] to i8
- // CHECK-NEXT: %[[D:.+]] = or i8 %[[T]], 48
+ // CHECK-NEXT: %[[D:.+]] = or{{( disjoint)?}} i8 %[[T]], 48
// CHECK-NEXT: ret i8 %[[D]]
// CHECK-NOT: icmp
diff --git a/tests/codegen/debug-accessibility/crate-enum.rs b/tests/codegen/debug-accessibility/crate-enum.rs
new file mode 100644
index 000000000..eeea18dd8
--- /dev/null
+++ b/tests/codegen/debug-accessibility/crate-enum.rs
@@ -0,0 +1,26 @@
+// compile-flags: -C debuginfo=2
+// ignore-tidy-linelength
+
+#![allow(dead_code)]
+
+// Checks that visibility information is present in the debuginfo for crate-visibility enums.
+
+mod module {
+ use std::hint::black_box;
+
+ pub(crate) enum CrateFooEnum {
+ A,
+ B(u32),
+ C { x: u32 },
+ }
+
+ // NONMSVC: {{!.*}} = !DICompositeType(tag: DW_TAG_structure_type, name: "CrateFooEnum"{{.*}}flags: DIFlagProtected{{.*}})
+ // MSVC: {{!.*}} = !DICompositeType(tag: DW_TAG_union_type, name: "enum2$<crate_enum::module::CrateFooEnum>"{{.*}}flags: DIFlagProtected{{.*}})
+ pub fn use_everything() {
+ black_box(CrateFooEnum::A);
+ }
+}
+
+fn main() {
+ module::use_everything();
+}
diff --git a/tests/codegen/debug-accessibility/crate-struct.rs b/tests/codegen/debug-accessibility/crate-struct.rs
new file mode 100644
index 000000000..68d126a34
--- /dev/null
+++ b/tests/codegen/debug-accessibility/crate-struct.rs
@@ -0,0 +1,23 @@
+// compile-flags: -C debuginfo=2
+
+#![allow(dead_code)]
+
+// Checks that visibility information is present in the debuginfo for crate-visibility structs.
+
+mod module {
+ use std::hint::black_box;
+
+ pub(crate) struct CrateFooStruct {
+ x: u32,
+ }
+
+ // CHECK: {{!.*}} = !DICompositeType(tag: DW_TAG_structure_type, name: "CrateFooStruct"{{.*}}flags: DIFlagProtected{{.*}})
+
+ pub fn use_everything() {
+ black_box(CrateFooStruct { x: 2 });
+ }
+}
+
+fn main() {
+ module::use_everything();
+}
diff --git a/tests/codegen/debug-accessibility/private-enum.rs b/tests/codegen/debug-accessibility/private-enum.rs
new file mode 100644
index 000000000..7f81026dd
--- /dev/null
+++ b/tests/codegen/debug-accessibility/private-enum.rs
@@ -0,0 +1,21 @@
+// compile-flags: -C debuginfo=2
+// ignore-tidy-linelength
+
+#![allow(dead_code)]
+
+// Checks that visibility information is present in the debuginfo for private enums.
+
+use std::hint::black_box;
+
+enum PrivateFooEnum {
+ A,
+ B(u32),
+ C { x: u32 },
+}
+
+// NONMSVC: {{!.*}} = !DICompositeType(tag: DW_TAG_structure_type, name: "PrivateFooEnum"{{.*}}flags: DIFlagPrivate{{.*}})
+// MSVC: {{!.*}} = !DICompositeType(tag: DW_TAG_union_type, name: "enum2$<private_enum::PrivateFooEnum>"{{.*}}flags: DIFlagPrivate{{.*}})
+
+fn main() {
+ black_box(PrivateFooEnum::A);
+}
diff --git a/tests/codegen/debug-accessibility/private-struct.rs b/tests/codegen/debug-accessibility/private-struct.rs
new file mode 100644
index 000000000..43b260f90
--- /dev/null
+++ b/tests/codegen/debug-accessibility/private-struct.rs
@@ -0,0 +1,17 @@
+// compile-flags: -C debuginfo=2
+
+#![allow(dead_code)]
+
+// Checks that visibility information is present in the debuginfo for private structs.
+
+use std::hint::black_box;
+
+struct PrivateFooStruct {
+ x: u32,
+}
+
+// CHECK: {{!.*}} = !DICompositeType(tag: DW_TAG_structure_type, name: "PrivateFooStruct"{{.*}}flags: DIFlagPrivate{{.*}})
+
+fn main() {
+ black_box(PrivateFooStruct { x: 1 });
+}
diff --git a/tests/codegen/debug-accessibility/public-enum.rs b/tests/codegen/debug-accessibility/public-enum.rs
new file mode 100644
index 000000000..29ae5fd64
--- /dev/null
+++ b/tests/codegen/debug-accessibility/public-enum.rs
@@ -0,0 +1,21 @@
+// compile-flags: -C debuginfo=2
+// ignore-tidy-linelength
+
+#![allow(dead_code)]
+
+// Checks that visibility information is present in the debuginfo for types and their fields.
+
+use std::hint::black_box;
+
+pub enum PublicFooEnum {
+ A,
+ B(u32),
+ C { x: u32 },
+}
+
+// NONMSVC: {{!.*}} = !DICompositeType(tag: DW_TAG_structure_type, name: "PublicFooEnum"{{.*}}flags: DIFlagPublic{{.*}})
+// MSVC: {{!.*}} = !DICompositeType(tag: DW_TAG_union_type, name: "enum2$<public_enum::PublicFooEnum>"{{.*}}flags: DIFlagPublic{{.*}})
+
+fn main() {
+ black_box(PublicFooEnum::A);
+}
diff --git a/tests/codegen/debug-accessibility/public-struct.rs b/tests/codegen/debug-accessibility/public-struct.rs
new file mode 100644
index 000000000..e7cd9b40d
--- /dev/null
+++ b/tests/codegen/debug-accessibility/public-struct.rs
@@ -0,0 +1,17 @@
+// compile-flags: -C debuginfo=2
+
+#![allow(dead_code)]
+
+// Checks that visibility information is present in the debuginfo for public structs.
+
+use std::hint::black_box;
+
+pub struct PublicFooStruct {
+ x: u32,
+}
+
+// CHECK: {{!.*}} = !DICompositeType(tag: DW_TAG_structure_type, name: "PublicFooStruct"{{.*}}flags: DIFlagPublic{{.*}})
+
+fn main() {
+ black_box(PublicFooStruct { x: 4 });
+}
diff --git a/tests/codegen/debug-accessibility/struct-fields.rs b/tests/codegen/debug-accessibility/struct-fields.rs
new file mode 100644
index 000000000..76831bdc6
--- /dev/null
+++ b/tests/codegen/debug-accessibility/struct-fields.rs
@@ -0,0 +1,30 @@
+// compile-flags: -C debuginfo=2
+
+#![allow(dead_code)]
+
+// Checks that visibility information is present in the debuginfo for struct fields.
+
+mod module {
+ use std::hint::black_box;
+
+ struct StructFields {
+ a: u32,
+ pub(crate) b: u32,
+ pub(super) c: u32,
+ pub d: u32,
+ }
+
+ // CHECK: [[StructFields:!.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "StructFields"{{.*}}flags: DIFlagPrivate{{.*}})
+ // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: [[StructFields]]{{.*}}flags: DIFlagPrivate{{.*}})
+ // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: [[StructFields]]{{.*}}flags: DIFlagProtected{{.*}})
+ // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: [[StructFields]]{{.*}}flags: DIFlagProtected{{.*}})
+ // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: [[StructFields]]{{.*}}flags: DIFlagPublic{{.*}})
+
+ pub fn use_everything() {
+ black_box(StructFields { a: 1, b: 2, c: 3, d: 4 });
+ }
+}
+
+fn main() {
+ module::use_everything();
+}
diff --git a/tests/codegen/debug-accessibility/super-enum.rs b/tests/codegen/debug-accessibility/super-enum.rs
new file mode 100644
index 000000000..9d83fb45b
--- /dev/null
+++ b/tests/codegen/debug-accessibility/super-enum.rs
@@ -0,0 +1,27 @@
+// compile-flags: -C debuginfo=2
+// ignore-tidy-linelength
+
+#![allow(dead_code)]
+
+// Checks that visibility information is present in the debuginfo for super-visibility enums.
+
+mod module {
+ use std::hint::black_box;
+
+ pub(super) enum SuperFooEnum {
+ A,
+ B(u32),
+ C { x: u32 },
+ }
+
+ // NONMSVC: {{!.*}} = !DICompositeType(tag: DW_TAG_structure_type, name: "SuperFooEnum"{{.*}}flags: DIFlagProtected{{.*}})
+ // MSVC: {{!.*}} = !DICompositeType(tag: DW_TAG_union_type, name: "enum2$<super_enum::module::SuperFooEnum>"{{.*}}flags: DIFlagProtected{{.*}})
+
+ pub fn use_everything() {
+ black_box(SuperFooEnum::A);
+ }
+}
+
+fn main() {
+ module::use_everything();
+}
diff --git a/tests/codegen/debug-accessibility/super-struct.rs b/tests/codegen/debug-accessibility/super-struct.rs
new file mode 100644
index 000000000..481006c39
--- /dev/null
+++ b/tests/codegen/debug-accessibility/super-struct.rs
@@ -0,0 +1,23 @@
+// compile-flags: -C debuginfo=2
+
+#![allow(dead_code)]
+
+// Checks that visibility information is present in the debuginfo for super-visibility structs.
+
+mod module {
+ use std::hint::black_box;
+
+ pub(super) struct SuperFooStruct {
+ x: u32,
+ }
+
+ // CHECK: {{!.*}} = !DICompositeType(tag: DW_TAG_structure_type, name: "SuperFooStruct"{{.*}}flags: DIFlagProtected{{.*}})
+
+ pub fn use_everything() {
+ black_box(SuperFooStruct { x: 3 });
+ }
+}
+
+fn main() {
+ module::use_everything();
+}
diff --git a/tests/codegen/debug-accessibility/tuple-fields.rs b/tests/codegen/debug-accessibility/tuple-fields.rs
new file mode 100644
index 000000000..1163ba2c7
--- /dev/null
+++ b/tests/codegen/debug-accessibility/tuple-fields.rs
@@ -0,0 +1,24 @@
+// compile-flags: -C debuginfo=2
+
+#![allow(dead_code)]
+
+// Checks that visibility information is present in the debuginfo for tuple struct fields.
+
+mod module {
+ use std::hint::black_box;
+
+ struct TupleFields(u32, pub(crate) u32, pub(super) u32, pub u32);
+
+ // CHECK: [[TupleFields:!.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "TupleFields"{{.*}}flags: DIFlagPrivate{{.*}})
+ // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "__0", scope: [[TupleFields]]{{.*}}flags: DIFlagPrivate{{.*}})
+ // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "__1", scope: [[TupleFields]]{{.*}}flags: DIFlagProtected{{.*}})
+ // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "__2", scope: [[TupleFields]]{{.*}}flags: DIFlagProtected{{.*}})
+ // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "__3", scope: [[TupleFields]]{{.*}}flags: DIFlagPublic{{.*}})
+ pub fn use_everything() {
+ black_box(TupleFields(1, 2, 3, 4));
+ }
+}
+
+fn main() {
+ module::use_everything();
+}
diff --git a/tests/codegen/default-hidden-visibility.rs b/tests/codegen/default-hidden-visibility.rs
new file mode 100644
index 000000000..9e5e545f0
--- /dev/null
+++ b/tests/codegen/default-hidden-visibility.rs
@@ -0,0 +1,31 @@
+// Verifies that `Session::default_hidden_visibility` is affected when using the related cmdline
+// flag. This is a regression test for https://github.com/rust-lang/compiler-team/issues/656. See
+// also https://github.com/rust-lang/rust/issues/73295 and
+// https://github.com/rust-lang/rust/issues/37530.
+
+// revisions:DEFAULT YES NO
+//[YES] compile-flags: -Zdefault-hidden-visibility=yes
+//[NO] compile-flags: -Zdefault-hidden-visibility=no
+
+// The test scenario is specifically about visibility of symbols exported out of dynamically linked
+// libraries.
+#![crate_type = "dylib"]
+
+// The test scenario needs to use a Rust-public, but non-explicitly-exported symbol
+// (e.g. the test doesn't use `#[no_mangle]`, because currently it implies that
+// the symbol should be exported; we don't want that - we want to test the *default*
+// export setting instead).
+#[used]
+pub static tested_symbol: [u8; 6] = *b"foobar";
+
+// Exact LLVM IR differs depending on the target triple (e.g. `hidden constant`
+// vs `internal constant` vs `constant`). Because of this, we only apply the
+// specific test expectations below to one specific target triple. If needed,
+// additional targets can be covered by adding copies of this test file with
+// a different `only-X` directive.
+//
+// only-x86_64-unknown-linux-gnu
+
+// DEFAULT: @{{.*}}default_hidden_visibility{{.*}}tested_symbol{{.*}} = constant
+// YES: @{{.*}}default_hidden_visibility{{.*}}tested_symbol{{.*}} = hidden constant
+// NO: @{{.*}}default_hidden_visibility{{.*}}tested_symbol{{.*}} = constant
diff --git a/tests/codegen/ehcontguard_disabled.rs b/tests/codegen/ehcontguard_disabled.rs
new file mode 100644
index 000000000..7773384e5
--- /dev/null
+++ b/tests/codegen/ehcontguard_disabled.rs
@@ -0,0 +1,10 @@
+// compile-flags:
+
+#![crate_type = "lib"]
+
+// A basic test function.
+pub fn test() {
+}
+
+// Ensure the module flag ehcontguard is not present
+// CHECK-NOT: !"ehcontguard"
diff --git a/tests/codegen/ehcontguard_enabled.rs b/tests/codegen/ehcontguard_enabled.rs
new file mode 100644
index 000000000..03aaa342b
--- /dev/null
+++ b/tests/codegen/ehcontguard_enabled.rs
@@ -0,0 +1,10 @@
+// compile-flags: -Z ehcont-guard
+
+#![crate_type = "lib"]
+
+// A basic test function.
+pub fn test() {
+}
+
+// Ensure the module flag ehcontguard=1 is present
+// CHECK: !"ehcontguard", i32 1
diff --git a/tests/codegen/function-return.rs b/tests/codegen/function-return.rs
new file mode 100644
index 000000000..d832d19ac
--- /dev/null
+++ b/tests/codegen/function-return.rs
@@ -0,0 +1,28 @@
+// Test that the `fn_ret_thunk_extern` function attribute is (not) emitted when
+// the `-Zfunction-return={keep,thunk-extern}` flag is (not) set.
+
+// revisions: unset keep thunk-extern keep-thunk-extern thunk-extern-keep
+// needs-llvm-components: x86
+// compile-flags: --target x86_64-unknown-linux-gnu
+// [keep] compile-flags: -Zfunction-return=keep
+// [thunk-extern] compile-flags: -Zfunction-return=thunk-extern
+// [keep-thunk-extern] compile-flags: -Zfunction-return=keep -Zfunction-return=thunk-extern
+// [thunk-extern-keep] compile-flags: -Zfunction-return=thunk-extern -Zfunction-return=keep
+
+#![crate_type = "lib"]
+#![feature(no_core, lang_items)]
+#![no_core]
+
+#[lang = "sized"]
+trait Sized {}
+
+#[no_mangle]
+pub fn foo() {
+ // CHECK: @foo() unnamed_addr #0
+
+ // unset-NOT: fn_ret_thunk_extern
+ // keep-NOT: fn_ret_thunk_extern
+ // thunk-extern: attributes #0 = { {{.*}}fn_ret_thunk_extern{{.*}} }
+ // keep-thunk-extern: attributes #0 = { {{.*}}fn_ret_thunk_extern{{.*}} }
+ // thunk-extern-keep-NOT: fn_ret_thunk_extern
+}
diff --git a/tests/codegen/issues/issue-101048.rs b/tests/codegen/issues/issue-101048.rs
index efa4db93e..e4712cf9c 100644
--- a/tests/codegen/issues/issue-101048.rs
+++ b/tests/codegen/issues/issue-101048.rs
@@ -1,5 +1,4 @@
// compile-flags: -O
-// min-llvm-version: 16
#![crate_type = "lib"]
diff --git a/tests/codegen/issues/issue-101082.rs b/tests/codegen/issues/issue-101082.rs
index 2cbe99942..58fcd75a8 100644
--- a/tests/codegen/issues/issue-101082.rs
+++ b/tests/codegen/issues/issue-101082.rs
@@ -1,5 +1,4 @@
// compile-flags: -O
-// min-llvm-version: 16
// ignore-debug: the debug assertions get in the way
#![crate_type = "lib"]
diff --git a/tests/codegen/issues/issue-101814.rs b/tests/codegen/issues/issue-101814.rs
index 13796352c..63a8cebcb 100644
--- a/tests/codegen/issues/issue-101814.rs
+++ b/tests/codegen/issues/issue-101814.rs
@@ -1,5 +1,4 @@
// compile-flags: -O
-// min-llvm-version: 16
// ignore-debug: the debug assertions get in the way
#![crate_type = "lib"]
diff --git a/tests/codegen/issues/issue-103132.rs b/tests/codegen/issues/issue-103132.rs
index cc87d7cd2..521d424c2 100644
--- a/tests/codegen/issues/issue-103132.rs
+++ b/tests/codegen/issues/issue-103132.rs
@@ -1,5 +1,4 @@
// compile-flags: -O -C overflow-checks
-// min-llvm-version: 16
#![crate_type = "lib"]
diff --git a/tests/codegen/issues/issue-103327.rs b/tests/codegen/issues/issue-103327.rs
index cee00facc..021f1ca0c 100644
--- a/tests/codegen/issues/issue-103327.rs
+++ b/tests/codegen/issues/issue-103327.rs
@@ -1,5 +1,4 @@
// compile-flags: -O
-// min-llvm-version: 16
#![crate_type = "lib"]
diff --git a/tests/codegen/issues/issue-103840.rs b/tests/codegen/issues/issue-103840.rs
index da64692d2..f19d7031b 100644
--- a/tests/codegen/issues/issue-103840.rs
+++ b/tests/codegen/issues/issue-103840.rs
@@ -1,5 +1,4 @@
// compile-flags: -O
-// min-llvm-version: 16.0
#![crate_type = "lib"]
pub fn foo(t: &mut Vec<usize>) {
diff --git a/tests/codegen/issues/issue-116878.rs b/tests/codegen/issues/issue-116878.rs
new file mode 100644
index 000000000..d5f679459
--- /dev/null
+++ b/tests/codegen/issues/issue-116878.rs
@@ -0,0 +1,13 @@
+// no-system-llvm
+// compile-flags: -O
+// ignore-debug: the debug assertions get in the way
+#![crate_type = "lib"]
+
+/// Make sure no bounds checks are emitted after a `get_unchecked`.
+// CHECK-LABEL: @unchecked_slice_no_bounds_check
+#[no_mangle]
+pub unsafe fn unchecked_slice_no_bounds_check(s: &[u8]) -> u8 {
+ let a = *s.get_unchecked(1);
+ // CHECK-NOT: panic_bounds_check
+ a + s[0]
+}
diff --git a/tests/codegen/issues/issue-75978.rs b/tests/codegen/issues/issue-75978.rs
index f335e92c3..abfafc35f 100644
--- a/tests/codegen/issues/issue-75978.rs
+++ b/tests/codegen/issues/issue-75978.rs
@@ -1,5 +1,4 @@
// compile-flags: -O
-// min-llvm-version: 16
#![crate_type = "lib"]
diff --git a/tests/codegen/issues/issue-86106.rs b/tests/codegen/issues/issue-86106.rs
index 15aef344a..5f71d46fb 100644
--- a/tests/codegen/issues/issue-86106.rs
+++ b/tests/codegen/issues/issue-86106.rs
@@ -9,9 +9,12 @@
// CHECK-LABEL: define {{(dso_local )?}}void @string_new
#[no_mangle]
pub fn string_new() -> String {
- // CHECK: store ptr inttoptr
+ // CHECK-NOT: load i8
+ // CHECK: store i{{32|64}}
// CHECK-NEXT: getelementptr
- // CHECK-NEXT: call void @llvm.memset
+ // CHECK-NEXT: store ptr
+ // CHECK-NEXT: getelementptr
+ // CHECK-NEXT: store i{{32|64}}
// CHECK-NEXT: ret void
String::new()
}
@@ -19,9 +22,12 @@ pub fn string_new() -> String {
// CHECK-LABEL: define {{(dso_local )?}}void @empty_to_string
#[no_mangle]
pub fn empty_to_string() -> String {
- // CHECK: store ptr inttoptr
+ // CHECK-NOT: load i8
+ // CHECK: store i{{32|64}}
+ // CHECK-NEXT: getelementptr
+ // CHECK-NEXT: store ptr
// CHECK-NEXT: getelementptr
- // CHECK-NEXT: call void @llvm.memset
+ // CHECK-NEXT: store i{{32|64}}
// CHECK-NEXT: ret void
"".to_string()
}
@@ -32,9 +38,12 @@ pub fn empty_to_string() -> String {
// CHECK-LABEL: @empty_vec
#[no_mangle]
pub fn empty_vec() -> Vec<u8> {
- // CHECK: store ptr inttoptr
+ // CHECK: store i{{32|64}}
+ // CHECK-NOT: load i8
// CHECK-NEXT: getelementptr
- // CHECK-NEXT: call void @llvm.memset
+ // CHECK-NEXT: store ptr
+ // CHECK-NEXT: getelementptr
+ // CHECK-NEXT: store i{{32|64}}
// CHECK-NEXT: ret void
vec![]
}
@@ -42,9 +51,12 @@ pub fn empty_vec() -> Vec<u8> {
// CHECK-LABEL: @empty_vec_clone
#[no_mangle]
pub fn empty_vec_clone() -> Vec<u8> {
- // CHECK: store ptr inttoptr
+ // CHECK: store i{{32|64}}
+ // CHECK-NOT: load i8
+ // CHECK-NEXT: getelementptr
+ // CHECK-NEXT: store ptr
// CHECK-NEXT: getelementptr
- // CHECK-NEXT: call void @llvm.memset
+ // CHECK-NEXT: store i{{32|64}}
// CHECK-NEXT: ret void
vec![].clone()
}
diff --git a/tests/codegen/issues/issue-99960.rs b/tests/codegen/issues/issue-99960.rs
index e9c9367fa..ad0315a82 100644
--- a/tests/codegen/issues/issue-99960.rs
+++ b/tests/codegen/issues/issue-99960.rs
@@ -1,5 +1,4 @@
// compile-flags: -O
-// min-llvm-version: 16
#![crate_type = "lib"]
diff --git a/tests/codegen/llvm_module_flags.rs b/tests/codegen/llvm_module_flags.rs
new file mode 100644
index 000000000..acc035086
--- /dev/null
+++ b/tests/codegen/llvm_module_flags.rs
@@ -0,0 +1,7 @@
+// Test for -Z llvm_module_flags
+// compile-flags: -Z llvm_module_flag=foo:u32:123:error -Z llvm_module_flag=bar:u32:42:max
+
+fn main() {}
+
+// CHECK: !{i32 1, !"foo", i32 123}
+// CHECK: !{i32 7, !"bar", i32 42}
diff --git a/tests/codegen/overaligned-constant.rs b/tests/codegen/overaligned-constant.rs
new file mode 100644
index 000000000..c94dfd85e
--- /dev/null
+++ b/tests/codegen/overaligned-constant.rs
@@ -0,0 +1,36 @@
+// GVN may create indirect constants with higher alignment than their type requires. Verify that we
+// do not ICE during codegen, and that the LLVM constant has the higher alignment.
+//
+// compile-flags: -Zmir-opt-level=0 -Zmir-enable-passes=+GVN
+// compile-flags: -Cno-prepopulate-passes
+// only-64bit
+
+struct S(i32);
+
+struct SmallStruct(f32, Option<S>, &'static [f32]);
+
+// CHECK: @0 = private unnamed_addr constant
+// CHECK-SAME: , align 8
+
+fn main() {
+ // CHECK-LABEL: @_ZN20overaligned_constant4main
+ // CHECK: [[full:%_.*]] = alloca %SmallStruct, align 8
+ // CHECK: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[full]], ptr align 8 @0, i64 32, i1 false)
+ // CHECK: %b.0 = load i32, ptr @0, align 4,
+ // CHECK: %b.1 = load i32, ptr getelementptr inbounds ({ i32, i32 }, ptr @0, i32 0, i32 1), align 4
+ let mut s = S(1);
+
+ s.0 = 3;
+
+ // SMALL_VAL corresponds to a MIR allocation with alignment 8.
+ const SMALL_VAL: SmallStruct = SmallStruct(4., Some(S(1)), &[]);
+
+ // In pre-codegen MIR:
+ // `a` is a scalar 4.
+ // `b` is an indirect constant at `SMALL_VAL`'s alloc with 0 offset.
+ // `c` is the empty slice.
+ //
+ // As a consequence, during codegen, we create a LLVM allocation for `SMALL_VAL`, with
+ // alignment 8, but only use the `Option<S>` field, at offset 0 with alignment 4.
+ let SmallStruct(a, b, c) = SMALL_VAL;
+}
diff --git a/tests/codegen/sanitizer/cfi-normalize-integers.rs b/tests/codegen/sanitizer/cfi-normalize-integers.rs
index 9663aa54c..d3cece4c7 100644
--- a/tests/codegen/sanitizer/cfi-normalize-integers.rs
+++ b/tests/codegen/sanitizer/cfi-normalize-integers.rs
@@ -6,78 +6,41 @@
#![crate_type="lib"]
extern crate core;
-use core::ffi::*;
pub fn foo0(_: bool) { }
// CHECK: define{{.*}}foo0{{.*}}!type ![[TYPE0:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo1(_: bool, _: c_uchar) { }
+pub fn foo1(_: bool, _: bool) { }
// CHECK: define{{.*}}foo1{{.*}}!type ![[TYPE1:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo2(_: bool, _: c_uchar, _: c_uchar) { }
+pub fn foo2(_: bool, _: bool, _: bool) { }
// CHECK: define{{.*}}foo2{{.*}}!type ![[TYPE2:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo3(_: isize) { }
+pub fn foo3(_: char) { }
// CHECK: define{{.*}}foo3{{.*}}!type ![[TYPE3:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo4(_: isize, _: c_long) { }
+pub fn foo4(_: char, _: char) { }
// CHECK: define{{.*}}foo4{{.*}}!type ![[TYPE4:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo5(_: isize, _: c_long, _: c_longlong) { }
+pub fn foo5(_: char, _: char, _: char) { }
// CHECK: define{{.*}}foo5{{.*}}!type ![[TYPE5:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo6(_: usize) { }
+pub fn foo6(_: isize) { }
// CHECK: define{{.*}}foo6{{.*}}!type ![[TYPE6:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo7(_: usize, _: c_ulong) { }
+pub fn foo7(_: isize, _: isize) { }
// CHECK: define{{.*}}foo7{{.*}}!type ![[TYPE7:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo8(_: usize, _: c_ulong, _: c_ulonglong) { }
+pub fn foo8(_: isize, _: isize, _: isize) { }
// CHECK: define{{.*}}foo8{{.*}}!type ![[TYPE8:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo9(_: c_schar) { }
+pub fn foo9(_: (), _: usize) { }
// CHECK: define{{.*}}foo9{{.*}}!type ![[TYPE9:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo10(_: c_char, _: c_schar) { }
+pub fn foo10(_: (), _: usize, _: usize) { }
// CHECK: define{{.*}}foo10{{.*}}!type ![[TYPE10:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo11(_: c_char, _: c_schar, _: c_schar) { }
+pub fn foo11(_: (), _: usize, _: usize, _: usize) { }
// CHECK: define{{.*}}foo11{{.*}}!type ![[TYPE11:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo12(_: c_int) { }
-// CHECK: define{{.*}}foo12{{.*}}!type ![[TYPE12:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo13(_: c_int, _: c_int) { }
-// CHECK: define{{.*}}foo13{{.*}}!type ![[TYPE13:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo14(_: c_int, _: c_int, _: c_int) { }
-// CHECK: define{{.*}}foo14{{.*}}!type ![[TYPE14:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo15(_: c_short) { }
-// CHECK: define{{.*}}foo15{{.*}}!type ![[TYPE15:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo16(_: c_short, _: c_short) { }
-// CHECK: define{{.*}}foo16{{.*}}!type ![[TYPE16:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo17(_: c_short, _: c_short, _: c_short) { }
-// CHECK: define{{.*}}foo17{{.*}}!type ![[TYPE17:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo18(_: c_uint) { }
-// CHECK: define{{.*}}foo18{{.*}}!type ![[TYPE18:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo19(_: c_uint, _: c_uint) { }
-// CHECK: define{{.*}}foo19{{.*}}!type ![[TYPE19:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo20(_: c_uint, _: c_uint, _: c_uint) { }
-// CHECK: define{{.*}}foo20{{.*}}!type ![[TYPE20:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo21(_: c_ushort) { }
-// CHECK: define{{.*}}foo21{{.*}}!type ![[TYPE21:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo22(_: c_ushort, _: c_ushort) { }
-// CHECK: define{{.*}}foo22{{.*}}!type ![[TYPE22:[0-9]+]] !type !{{[0-9]+}}
-pub fn foo23(_: c_ushort, _: c_ushort, _: c_ushort) { }
-// CHECK: define{{.*}}foo23{{.*}}!type ![[TYPE23:[0-9]+]] !type !{{[0-9]+}}
// CHECK: ![[TYPE0]] = !{i64 0, !"_ZTSFvu2u8E.normalized"}
// CHECK: ![[TYPE1]] = !{i64 0, !"_ZTSFvu2u8S_E.normalized"}
// CHECK: ![[TYPE2]] = !{i64 0, !"_ZTSFvu2u8S_S_E.normalized"}
-// CHECK: ![[TYPE3]] = !{i64 0, !"_ZTSFv{{u3i16|u3i32|u3i64}}E.normalized"}
-// CHECK: ![[TYPE4]] = !{i64 0, !"_ZTSFv{{u3i16|u3i32|u3i64}}{{u3i32|u3i64|S_}}E.normalized"}
-// CHECK: ![[TYPE5]] = !{i64 0, !"_ZTSFv{{u3i16|u3i32|u3i64}}{{u3i32|u3i64|S_}}{{u3i64|S_|S0_}}E.normalized"}
-// CHECK: ![[TYPE6]] = !{i64 0, !"_ZTSFv{{u3u16|u3u32|u3u64}}E.normalized"}
-// CHECK: ![[TYPE7]] = !{i64 0, !"_ZTSFv{{u3u16|u3u32|u3u64}}{{u3u32|u3u64|S_}}E.normalized"}
-// CHECK: ![[TYPE8]] = !{i64 0, !"_ZTSFv{{u3u16|u3u32|u3u64}}{{u3u32|u3u64|S_}}{{u3u64|S_|S0_}}E.normalized"}
-// CHECK: ![[TYPE9]] = !{i64 0, !"_ZTSFvu2i8E.normalized"}
-// CHECK: ![[TYPE10]] = !{i64 0, !"_ZTSFv{{u2i8S_|u2u8u2i8}}E.normalized"}
-// CHECK: ![[TYPE11]] = !{i64 0, !"_ZTSFv{{u2i8S_S_|u2u8u2i8S0_}}E.normalized"}
-// CHECK: ![[TYPE12]] = !{i64 0, !"_ZTSFv{{u3i16|u3i32|u3i64}}E.normalized"}
-// CHECK: ![[TYPE13]] = !{i64 0, !"_ZTSFv{{u3i16|u3i32|u3i64}}S_E.normalized"}
-// CHECK: ![[TYPE14]] = !{i64 0, !"_ZTSFv{{u3i16|u3i32|u3i64}}S_S_E.normalized"}
-// CHECK: ![[TYPE15]] = !{i64 0, !"_ZTSFvu3i16E.normalized"}
-// CHECK: ![[TYPE16]] = !{i64 0, !"_ZTSFvu3i16S_E.normalized"}
-// CHECK: ![[TYPE17]] = !{i64 0, !"_ZTSFvu3i16S_S_E.normalized"}
-// CHECK: ![[TYPE18]] = !{i64 0, !"_ZTSFv{{u3u16|u3u32|u3u64}}E.normalized"}
-// CHECK: ![[TYPE19]] = !{i64 0, !"_ZTSFv{{u3u16|u3u32|u3u64}}S_E.normalized"}
-// CHECK: ![[TYPE20]] = !{i64 0, !"_ZTSFv{{u3u16|u3u32|u3u64}}S_S_E.normalized"}
-// CHECK: ![[TYPE21]] = !{i64 0, !"_ZTSFvu3u16E.normalized"}
-// CHECK: ![[TYPE22]] = !{i64 0, !"_ZTSFvu3u16S_E.normalized"}
-// CHECK: ![[TYPE23]] = !{i64 0, !"_ZTSFvu3u16S_S_E.normalized"}
+// CHECK: ![[TYPE3]] = !{i64 0, !"_ZTSFvu3u32E.normalized"}
+// CHECK: ![[TYPE4]] = !{i64 0, !"_ZTSFvu3u32S_E.normalized"}
+// CHECK: ![[TYPE5]] = !{i64 0, !"_ZTSFvu3u32S_S_E.normalized"}
+// CHECK: ![[TYPE6]] = !{i64 0, !"_ZTSFv{{u3i16|u3i32|u3i64|u4i128}}E.normalized"}
+// CHECK: ![[TYPE7]] = !{i64 0, !"_ZTSFv{{u3i16|u3i32|u3i64|u4i128}}S_E.normalized"}
+// CHECK: ![[TYPE8]] = !{i64 0, !"_ZTSFv{{u3i16|u3i32|u3i64|u4i128}}S_S_E.normalized"}
+// CHECK: ![[TYPE9]] = !{i64 0, !"_ZTSFvv{{u3u16|u3u32|u3u64|u4u128}}E.normalized"}
+// CHECK: ![[TYPE10]] = !{i64 0, !"_ZTSFvv{{u3u16|u3u32|u3u64|u4u128}}S_E.normalized"}
+// CHECK: ![[TYPE11]] = !{i64 0, !"_ZTSFvv{{u3u16|u3u32|u3u64|u4u128}}S_S_E.normalized"}
diff --git a/tests/codegen/sanitizer/kasan-emits-instrumentation.rs b/tests/codegen/sanitizer/kasan-emits-instrumentation.rs
index 29d50d8df..18d315c95 100644
--- a/tests/codegen/sanitizer/kasan-emits-instrumentation.rs
+++ b/tests/codegen/sanitizer/kasan-emits-instrumentation.rs
@@ -6,10 +6,8 @@
//[aarch64] needs-llvm-components: aarch64
//[riscv64imac] compile-flags: --target riscv64imac-unknown-none-elf
//[riscv64imac] needs-llvm-components: riscv
-//[riscv64imac] min-llvm-version: 16
//[riscv64gc] compile-flags: --target riscv64gc-unknown-none-elf
//[riscv64gc] needs-llvm-components: riscv
-//[riscv64gc] min-llvm-version: 16
//[x86_64] compile-flags: --target x86_64-unknown-none
//[x86_64] needs-llvm-components: x86
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-load.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-load.rs
new file mode 100644
index 000000000..e573b7d21
--- /dev/null
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-load.rs
@@ -0,0 +1,34 @@
+// compile-flags: -C no-prepopulate-passes
+
+#![crate_type = "lib"]
+
+#![feature(repr_simd, platform_intrinsics)]
+#![allow(non_camel_case_types)]
+
+#[repr(simd)]
+#[derive(Copy, Clone, PartialEq, Debug)]
+pub struct Vec2<T>(pub T, pub T);
+
+#[repr(simd)]
+#[derive(Copy, Clone, PartialEq, Debug)]
+pub struct Vec4<T>(pub T, pub T, pub T, pub T);
+
+extern "platform-intrinsic" {
+ fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
+}
+
+// CHECK-LABEL: @load_f32x2
+#[no_mangle]
+pub unsafe fn load_f32x2(mask: Vec2<i32>, pointer: *const f32,
+ values: Vec2<f32>) -> Vec2<f32> {
+ // CHECK: call <2 x float> @llvm.masked.load.v2f32.p0(ptr {{.*}}, i32 4, <2 x i1> {{.*}}, <2 x float> {{.*}})
+ simd_masked_load(mask, pointer, values)
+}
+
+// CHECK-LABEL: @load_pf32x4
+#[no_mangle]
+pub unsafe fn load_pf32x4(mask: Vec4<i32>, pointer: *const *const f32,
+ values: Vec4<*const f32>) -> Vec4<*const f32> {
+ // CHECK: call <4 x ptr> @llvm.masked.load.v4p0.p0(ptr {{.*}}, i32 {{.*}}, <4 x i1> {{.*}}, <4 x ptr> {{.*}})
+ simd_masked_load(mask, pointer, values)
+}
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-store.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-store.rs
new file mode 100644
index 000000000..916566222
--- /dev/null
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-store.rs
@@ -0,0 +1,32 @@
+// compile-flags: -C no-prepopulate-passes
+
+#![crate_type = "lib"]
+
+#![feature(repr_simd, platform_intrinsics)]
+#![allow(non_camel_case_types)]
+
+#[repr(simd)]
+#[derive(Copy, Clone, PartialEq, Debug)]
+pub struct Vec2<T>(pub T, pub T);
+
+#[repr(simd)]
+#[derive(Copy, Clone, PartialEq, Debug)]
+pub struct Vec4<T>(pub T, pub T, pub T, pub T);
+
+extern "platform-intrinsic" {
+ fn simd_masked_store<M, P, T>(mask: M, pointer: P, values: T) -> ();
+}
+
+// CHECK-LABEL: @store_f32x2
+#[no_mangle]
+pub unsafe fn store_f32x2(mask: Vec2<i32>, pointer: *mut f32, values: Vec2<f32>) {
+ // CHECK: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr {{.*}}, i32 4, <2 x i1> {{.*}})
+ simd_masked_store(mask, pointer, values)
+}
+
+// CHECK-LABEL: @store_pf32x4
+#[no_mangle]
+pub unsafe fn store_pf32x4(mask: Vec4<i32>, pointer: *mut *const f32, values: Vec4<*const f32>) {
+ // CHECK: call void @llvm.masked.store.v4p0.p0(<4 x ptr> {{.*}}, ptr {{.*}}, i32 {{.*}}, <4 x i1> {{.*}})
+ simd_masked_store(mask, pointer, values)
+}
diff --git a/tests/codegen/simd/simd-wide-sum.rs b/tests/codegen/simd/simd-wide-sum.rs
index 6e7d3d931..109d53813 100644
--- a/tests/codegen/simd/simd-wide-sum.rs
+++ b/tests/codegen/simd/simd-wide-sum.rs
@@ -10,7 +10,7 @@
#![crate_type = "lib"]
#![feature(portable_simd)]
-use std::simd::{Simd, SimdUint};
+use std::simd::prelude::*;
const N: usize = 16;
#[no_mangle]
diff --git a/tests/codegen/slice-iter-fold.rs b/tests/codegen/slice-iter-fold.rs
index 9391c1761..a55425cb6 100644
--- a/tests/codegen/slice-iter-fold.rs
+++ b/tests/codegen/slice-iter-fold.rs
@@ -1,6 +1,5 @@
// ignore-debug: the debug assertions get in the way
// compile-flags: -O
-// min-llvm-version: 16
#![crate_type = "lib"]
// CHECK-LABEL: @slice_fold_to_last
diff --git a/tests/codegen/stack-probes-call.rs b/tests/codegen/stack-probes-call.rs
deleted file mode 100644
index a18fd41c2..000000000
--- a/tests/codegen/stack-probes-call.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-// 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
-//[i686] ignore-llvm-version: 16 - 99
-//[x86_64] compile-flags: --target x86_64-unknown-linux-gnu
-//[x86_64] needs-llvm-components: x86
-//[x86_64] ignore-llvm-version: 16 - 99
-
-#![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/tests/codegen/stack-probes-inline.rs b/tests/codegen/stack-probes-inline.rs
index a6b781de5..34027e918 100644
--- a/tests/codegen/stack-probes-inline.rs
+++ b/tests/codegen/stack-probes-inline.rs
@@ -2,7 +2,9 @@
// or `StackProbeType::InlineOrCall` when running on newer LLVM.
// compile-flags: -C no-prepopulate-passes
-// revisions: powerpc powerpc64 powerpc64le s390x i686 x86_64
+// revisions: aarch64 powerpc powerpc64 powerpc64le s390x i686 x86_64
+//[aarch64] compile-flags: --target aarch64-unknown-linux-gnu
+//[aarch64] needs-llvm-components: aarch64
//[powerpc] compile-flags: --target powerpc-unknown-linux-gnu
//[powerpc] needs-llvm-components: powerpc
//[powerpc64] compile-flags: --target powerpc64-unknown-linux-gnu
@@ -13,10 +15,8 @@
//[s390x] needs-llvm-components: systemz
//[i686] compile-flags: --target i686-unknown-linux-gnu
//[i686] needs-llvm-components: x86
-//[i686] min-llvm-version: 16
//[x86_64] compile-flags: --target x86_64-unknown-linux-gnu
//[x86_64] needs-llvm-components: x86
-//[x86_64] min-llvm-version: 16
#![crate_type = "rlib"]
#![feature(no_core, lang_items)]
diff --git a/tests/codegen/thin-lto.rs b/tests/codegen/thin-lto.rs
new file mode 100644
index 000000000..7991cad7a
--- /dev/null
+++ b/tests/codegen/thin-lto.rs
@@ -0,0 +1,7 @@
+// compile-flags: -O -C lto=thin -C prefer-dynamic=no
+// only-x86_64-unknown-linux-gnu
+
+// CHECK: main
+
+pub fn main() {
+}
diff --git a/tests/codegen/unchecked_shifts.rs b/tests/codegen/unchecked_shifts.rs
index aca9bec77..eded894c6 100644
--- a/tests/codegen/unchecked_shifts.rs
+++ b/tests/codegen/unchecked_shifts.rs
@@ -31,7 +31,7 @@ pub unsafe fn unchecked_shl_unsigned_smaller(a: u16, b: u32) -> u16 {
#[no_mangle]
pub unsafe fn unchecked_shl_unsigned_bigger(a: u64, b: u32) -> u64 {
// CHECK-NOT: assume
- // CHECK: %[[EXT:.+]] = zext i32 %b to i64
+ // CHECK: %[[EXT:.+]] = zext{{( nneg)?}} i32 %b to i64
// CHECK: shl i64 %a, %[[EXT]]
a.unchecked_shl(b)
}
@@ -63,7 +63,7 @@ pub unsafe fn unchecked_shr_signed_smaller(a: i16, b: u32) -> i16 {
#[no_mangle]
pub unsafe fn unchecked_shr_signed_bigger(a: i64, b: u32) -> i64 {
// CHECK-NOT: assume
- // CHECK: %[[EXT:.+]] = zext i32 %b to i64
+ // CHECK: %[[EXT:.+]] = zext{{( nneg)?}} i32 %b to i64
// CHECK: ashr i64 %a, %[[EXT]]
a.unchecked_shr(b)
}
diff --git a/tests/codegen/vec-in-place.rs b/tests/codegen/vec-in-place.rs
index d68067ceb..5cf7add83 100644
--- a/tests/codegen/vec-in-place.rs
+++ b/tests/codegen/vec-in-place.rs
@@ -1,6 +1,5 @@
// ignore-debug: the debug assertions get in the way
// compile-flags: -O -Z merge-functions=disabled
-// min-llvm-version: 16
#![crate_type = "lib"]
// Ensure that trivial casts of vec elements are O(1)