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.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/crates/hir-ty/src/consteval/tests/intrinsics.rs b/crates/hir-ty/src/consteval/tests/intrinsics.rs
index 40e68823ac..0dd120e5b9 100644
--- a/crates/hir-ty/src/consteval/tests/intrinsics.rs
+++ b/crates/hir-ty/src/consteval/tests/intrinsics.rs
@@ -289,3 +289,31 @@ fn copy() {
19,
);
}
+
+#[test]
+fn ctpop() {
+ check_number(
+ r#"
+ extern "rust-intrinsic" {
+ pub fn ctpop<T: Copy>(x: T) -> T;
+ }
+
+ const GOAL: i64 = ctpop(-29);
+ "#,
+ 61,
+ );
+}
+
+#[test]
+fn cttz() {
+ check_number(
+ r#"
+ extern "rust-intrinsic" {
+ pub fn cttz<T: Copy>(x: T) -> T;
+ }
+
+ const GOAL: i64 = cttz(-24);
+ "#,
+ 3,
+ );
+}