diff --git a/gcc/testsuite/rust/compile/cttz.rs b/gcc/testsuite/rust/compile/cttz.rs
new file mode 100644
index 000000000..b072167ac
--- /dev/null
+++ b/gcc/testsuite/rust/compile/cttz.rs
@@ -0,0 +1,17 @@
+// { dg-do compile }
+#![feature(intrinsics, lang_items, no_core)]
+#![no_core]
+
+#[lang = "sized"]
+pub trait Sized {}
+
+#[lang = "copy"]
+pub trait Copy {}
+
+extern "rust-intrinsic" {
+    pub fn cttz<T>(x: T) -> u32; // { dg-error "cttz intrinsics can only be used with basic integer types .got 'bool'." }
+}
+
+fn main() {
+    let _ = cttz(true);
+}
diff --git a/gcc/testsuite/rust/compile/cttz_nonzero.rs b/gcc/testsuite/rust/compile/cttz_nonzero.rs
new file mode 100644
index 000000000..210bd8bd2
--- /dev/null
+++ b/gcc/testsuite/rust/compile/cttz_nonzero.rs
@@ -0,0 +1,19 @@
+// { dg-do compile }
+#![feature(intrinsics, lang_items, no_core)]
+#![no_core]
+
+#[lang = "sized"]
+pub trait Sized {}
+
+#[lang = "copy"]
+pub trait Copy {}
+
+extern "rust-intrinsic" {
+    pub fn cttz_nonzero<T>(x: T) -> u32; // { dg-error "cttz intrinsics can only be used with basic integer types .got 'bool'." }
+}
+
+fn main() {
+    unsafe {
+        let _ = cttz_nonzero(true);
+    }
+}
diff --git a/gcc/testsuite/rust/execute/torture/cttz.rs b/gcc/testsuite/rust/execute/torture/cttz.rs
new file mode 100644
index 000000000..d9f4656de
--- /dev/null
+++ b/gcc/testsuite/rust/execute/torture/cttz.rs
@@ -0,0 +1,97 @@
+#![feature(no_core)]
+#![no_core]
+#![feature(intrinsics)]
+#![feature(lang_items)]
+
+#[lang = "sized"]
+pub trait Sized {}
+
+extern "rust-intrinsic" {
+    pub fn cttz<T>(x: T) -> u32;
+    pub fn abort() -> !;
+}
+
+fn main() -> i32 {
+    // cttz(0) must return bit_size per the Rust reference
+    if cttz(0u8) != 8 {
+        abort();
+    }
+    if cttz(1u8) != 0 {
+        abort();
+    }
+    if cttz(0xFFu8) != 0 {
+        abort();
+    }
+
+    if cttz(0u16) != 16 {
+        abort();
+    }
+    if cttz(1u16) != 0 {
+        abort();
+    }
+    if cttz(0xFFFFu16) != 0 {
+        abort();
+    }
+
+    if cttz(0u32) != 32 {
+        abort();
+    }
+    if cttz(1u32) != 0 {
+        abort();
+    }
+    if cttz(0xFFFFFFFFu32) != 0 {
+        abort();
+    }
+
+    if cttz(0u64) != 64 {
+        abort();
+    }
+    if cttz(1u64) != 0 {
+        abort();
+    }
+    if cttz(!0u64) != 0 {
+        abort();
+    }
+
+    if cttz(0i8) != 8 {
+        abort();
+    }
+    if cttz(1i8) != 0 {
+        abort();
+    }
+    if cttz(-1i8) != 0 {
+        abort();
+    }
+
+    if cttz(0i16) != 16 {
+        abort();
+    }
+    if cttz(1i16) != 0 {
+        abort();
+    }
+    if cttz(-1i16) != 0 {
+        abort();
+    }
+
+    if cttz(0i32) != 32 {
+        abort();
+    }
+    if cttz(1i32) != 0 {
+        abort();
+    }
+    if cttz(-1i32) != 0 {
+        abort();
+    }
+
+    if cttz(0i64) != 64 {
+        abort();
+    }
+    if cttz(1i64) != 0 {
+        abort();
+    }
+    if cttz(-1i64) != 0 {
+        abort();
+    }
+
+    0
+}
diff --git a/gcc/testsuite/rust/execute/torture/cttz_nonzero.rs b/gcc/testsuite/rust/execute/torture/cttz_nonzero.rs
new file mode 100644
index 000000000..749dffaf6
--- /dev/null
+++ b/gcc/testsuite/rust/execute/torture/cttz_nonzero.rs
@@ -0,0 +1,74 @@
+#![feature(no_core)]
+#![no_core]
+#![feature(intrinsics)]
+#![feature(lang_items)]
+
+#[lang = "sized"]
+pub trait Sized {}
+
+extern "rust-intrinsic" {
+    pub fn cttz_nonzero<T>(x: T) -> u32;
+    pub fn abort() -> !;
+}
+
+fn main() -> i32 {
+    unsafe {
+        if cttz_nonzero(1u8) != 0 {
+            abort();
+        }
+        if cttz_nonzero(0xFFu8) != 0 {
+            abort();
+        }
+
+        if cttz_nonzero(1u16) != 0 {
+            abort();
+        }
+        if cttz_nonzero(0xFFFFu16) != 0 {
+            abort();
+        }
+
+        if cttz_nonzero(1u32) != 0 {
+            abort();
+        }
+        if cttz_nonzero(0xFFFFFFFFu32) != 0 {
+            abort();
+        }
+
+        if cttz_nonzero(1u64) != 0 {
+            abort();
+        }
+        if cttz_nonzero(!0u64) != 0 {
+            abort();
+        }
+
+        if cttz_nonzero(1i8) != 0 {
+            abort();
+        }
+        if cttz_nonzero(-1i8) != 0 {
+            abort();
+        }
+
+        if cttz_nonzero(1i16) != 0 {
+            abort();
+        }
+        if cttz_nonzero(-1i16) != 0 {
+            abort();
+        }
+
+        if cttz_nonzero(1i32) != 0 {
+            abort();
+        }
+        if cttz_nonzero(-1i32) != 0 {
+            abort();
+        }
+
+        if cttz_nonzero(1i64) != 0 {
+            abort();
+        }
+        if cttz_nonzero(-1i64) != 0 {
+            abort();
+        }
+    }
+
+    0
+}
