diff --git a/target-spec/src/spec.rs b/target-spec/src/spec.rs
index 46c56fa6acc..03d77d145bb 100644
--- a/target-spec/src/spec.rs
+++ b/target-spec/src/spec.rs
@@ -176,6 +176,14 @@ mod tests {
         );
     }
 
+    #[test]
+    fn test_target_abi() {
+        assert!(matches!(
+            TargetSpec::new("cfg(any(target_arch = \"wasm32\", target_abi = \"unknown\"))"),
+            Ok(TargetSpec::Expression(_))
+        ));
+    }
+
     #[test]
     fn test_not() {
         assert!(matches!(