Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/consteval/tests/intrinsics.rs')
-rw-r--r--crates/hir-ty/src/consteval/tests/intrinsics.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/crates/hir-ty/src/consteval/tests/intrinsics.rs b/crates/hir-ty/src/consteval/tests/intrinsics.rs
index 85e917fe1a..1772e3c172 100644
--- a/crates/hir-ty/src/consteval/tests/intrinsics.rs
+++ b/crates/hir-ty/src/consteval/tests/intrinsics.rs
@@ -691,6 +691,33 @@ fn cttz() {
"#,
3,
);
+ check_number(
+ r#"
+ #[rustc_intrinsic]
+ pub fn cttz<T: Copy>(x: T) -> T;
+
+ const GOAL: i8 = cttz(0i8);
+ "#,
+ 8,
+ );
+ check_number(
+ r#"
+ #[rustc_intrinsic]
+ pub fn cttz<T: Copy>(x: T) -> T;
+
+ const GOAL: u32 = cttz(0u32);
+ "#,
+ 32,
+ );
+ check_number(
+ r#"
+ #[rustc_intrinsic]
+ pub fn cttz<T: Copy>(x: T) -> T;
+
+ const GOAL: u64 = cttz(0u64);
+ "#,
+ 64,
+ );
}
#[test]