summaryrefslogtreecommitdiffstats
path: root/tests/ui/feature-gates/feature-gate-abi-avr-interrupt.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
commita4b7ed7a42c716ab9f05e351f003d589124fd55d (patch)
treeb620cd3f223850b28716e474e80c58059dca5dd4 /tests/ui/feature-gates/feature-gate-abi-avr-interrupt.rs
parentAdding upstream version 1.67.1+dfsg1. (diff)
downloadrustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz
rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/feature-gates/feature-gate-abi-avr-interrupt.rs')
-rw-r--r--tests/ui/feature-gates/feature-gate-abi-avr-interrupt.rs51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/ui/feature-gates/feature-gate-abi-avr-interrupt.rs b/tests/ui/feature-gates/feature-gate-abi-avr-interrupt.rs
new file mode 100644
index 000000000..05461297a
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-abi-avr-interrupt.rs
@@ -0,0 +1,51 @@
+// needs-llvm-components: avr
+// compile-flags: --target=avr-unknown-gnu-atmega328 --crate-type=rlib
+#![no_core]
+#![feature(no_core, lang_items)]
+#[lang="sized"]
+trait Sized { }
+
+// Test that the AVR interrupt ABI cannot be used when avr_interrupt
+// feature gate is not used.
+
+extern "avr-non-blocking-interrupt" fn fu() {}
+//~^ ERROR avr-interrupt and avr-non-blocking-interrupt ABIs are experimental
+extern "avr-interrupt" fn f() {}
+//~^ ERROR avr-interrupt and avr-non-blocking-interrupt ABIs are experimental
+
+trait T {
+ extern "avr-interrupt" fn m();
+ //~^ ERROR avr-interrupt and avr-non-blocking-interrupt ABIs are experimental
+ extern "avr-non-blocking-interrupt" fn mu();
+ //~^ ERROR avr-interrupt and avr-non-blocking-interrupt ABIs are experimental
+
+ extern "avr-interrupt" fn dm() {}
+ //~^ ERROR avr-interrupt and avr-non-blocking-interrupt ABIs are experimental
+ extern "avr-non-blocking-interrupt" fn dmu() {}
+ //~^ ERROR avr-interrupt and avr-non-blocking-interrupt ABIs are experimental
+}
+
+struct S;
+impl T for S {
+ extern "avr-interrupt" fn m() {}
+ //~^ ERROR avr-interrupt and avr-non-blocking-interrupt ABIs are experimental
+ extern "avr-non-blocking-interrupt" fn mu() {}
+ //~^ ERROR avr-interrupt and avr-non-blocking-interrupt ABIs are experimental
+}
+
+impl S {
+ extern "avr-interrupt" fn im() {}
+ //~^ ERROR avr-interrupt and avr-non-blocking-interrupt ABIs are experimental
+ extern "avr-non-blocking-interrupt" fn imu() {}
+ //~^ ERROR avr-interrupt and avr-non-blocking-interrupt ABIs are experimental
+}
+
+type TA = extern "avr-interrupt" fn();
+//~^ ERROR avr-interrupt and avr-non-blocking-interrupt ABIs are experimental
+type TAU = extern "avr-non-blocking-interrupt" fn();
+//~^ ERROR avr-interrupt and avr-non-blocking-interrupt ABIs are experimental
+
+extern "avr-interrupt" {}
+//~^ ERROR avr-interrupt and avr-non-blocking-interrupt ABIs are experimental
+extern "avr-non-blocking-interrupt" {}
+//~^ ERROR avr-interrupt and avr-non-blocking-interrupt ABIs are experimental