summaryrefslogtreecommitdiffstats
path: root/tests/ui/asm/issue-89305.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/asm/issue-89305.rs')
-rw-r--r--tests/ui/asm/issue-89305.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/asm/issue-89305.rs b/tests/ui/asm/issue-89305.rs
new file mode 100644
index 000000000..05677912d
--- /dev/null
+++ b/tests/ui/asm/issue-89305.rs
@@ -0,0 +1,16 @@
+// Regression test for #89305, where a variable was erroneously reported
+// as both unused and possibly-uninitialized.
+
+// check-pass
+// needs-asm-support
+
+#![warn(unused)]
+
+use std::arch::asm;
+
+fn main() {
+ unsafe {
+ let x: () = asm!("nop");
+ //~^ WARNING: unused variable: `x`
+ }
+}