about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-10-27 03:08:47 +0000
committerbors <bors@rust-lang.org>2021-10-27 03:08:47 +0000
commita9b2bfb5edbe879b3bd21986c3da997c21737ab1 (patch)
tree641c403918e18a5cbec0c17cf4b40c7eb14c4acc /src/test/ui
parente269e6bf47f40c9046cd44ab787881d700099252 (diff)
parent12647eab7945df1ceddd4d191cdb489abfb05276 (diff)
downloadrust-a9b2bfb5edbe879b3bd21986c3da997c21737ab1.tar.gz
rust-a9b2bfb5edbe879b3bd21986c3da997c21737ab1.zip
Auto merge of #89937 - JohnTitor:fix-89875, r=Amanieu
Properly check `target_features` not to trigger an assertion

Fixes #89875
I think it should be a condition instead of an assertion to check if it's a register as it's possible that `reg` is a register class.
Also, this isn't related to the issue directly, but `is_target_supported` doesn't check `target_features` attributes. Is there any way to check it on rustc_codegen_llvm?

r? `@Amanieu`
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/asm/x86_64/issue-89875.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/asm/x86_64/issue-89875.rs b/src/test/ui/asm/x86_64/issue-89875.rs
new file mode 100644
index 00000000000..9b2b21bbda6
--- /dev/null
+++ b/src/test/ui/asm/x86_64/issue-89875.rs
@@ -0,0 +1,14 @@
+// build-pass
+// only-x86_64
+
+#![feature(asm, target_feature_11)]
+
+#[target_feature(enable = "avx")]
+fn main() {
+    unsafe {
+        asm!(
+            "/* {} */",
+            out(ymm_reg) _,
+        );
+    }
+}