summaryrefslogtreecommitdiffstats
path: root/src/test/ui/unwind-abis/feature-gate-thiscall-unwind.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/unwind-abis/feature-gate-thiscall-unwind.rs39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/test/ui/unwind-abis/feature-gate-thiscall-unwind.rs b/src/test/ui/unwind-abis/feature-gate-thiscall-unwind.rs
new file mode 100644
index 000000000..0a323e50f
--- /dev/null
+++ b/src/test/ui/unwind-abis/feature-gate-thiscall-unwind.rs
@@ -0,0 +1,39 @@
+// gate-test-abi_thiscall
+// gate-test-c_unwind
+// needs-llvm-components: x86
+// compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib
+#![no_core]
+#![feature(no_core, lang_items)]
+#[lang="sized"]
+trait Sized { }
+
+// Test that the "thiscall-unwind" ABI is feature-gated, and cannot be used when
+// the `c_unwind` feature gate is not used.
+
+extern "thiscall-unwind" fn fu() {} //~ ERROR thiscall-unwind ABI is experimental
+extern "thiscall" fn f() {} //~ ERROR thiscall is experimental
+
+trait T {
+ extern "thiscall" fn m(); //~ ERROR thiscall is experimental
+ extern "thiscall-unwind" fn mu(); //~ ERROR thiscall-unwind ABI is experimental
+
+ extern "thiscall" fn dm() {} //~ ERROR thiscall is experimental
+ extern "thiscall-unwind" fn dmu() {} //~ ERROR thiscall-unwind ABI is experimental
+}
+
+struct S;
+impl T for S {
+ extern "thiscall" fn m() {} //~ ERROR thiscall is experimental
+ extern "thiscall-unwind" fn mu() {} //~ ERROR thiscall-unwind ABI is experimental
+}
+
+impl S {
+ extern "thiscall" fn im() {} //~ ERROR thiscall is experimental
+ extern "thiscall-unwind" fn imu() {} //~ ERROR thiscall-unwind ABI is experimental
+}
+
+type TA = extern "thiscall" fn(); //~ ERROR thiscall is experimental
+type TAU = extern "thiscall-unwind" fn(); //~ ERROR thiscall-unwind ABI is experimental
+
+extern "thiscall" {} //~ ERROR thiscall is experimental
+extern "thiscall-unwind" {} //~ ERROR thiscall-unwind ABI is experimental