gccrs: Add test
authorOwen Avery <powerboat9.gamer@gmail.com>
Mon, 13 Feb 2023 16:29:07 +0000 (11:29 -0500)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 6 Apr 2023 08:47:22 +0000 (10:47 +0200)
gcc/testsuite/ChangeLog:

* rust/compile/variadic.rs: New test.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/testsuite/rust/compile/variadic.rs [new file with mode: 0644]

diff --git a/gcc/testsuite/rust/compile/variadic.rs b/gcc/testsuite/rust/compile/variadic.rs
new file mode 100644 (file)
index 0000000..886341b
--- /dev/null
@@ -0,0 +1,8 @@
+extern "C" {
+    fn printf(s: *const i8, ...);
+}
+
+fn main() {
+    // { dg-error "expected .c_int. variadic argument" "" { target *-*-* } .+1 }
+    printf("%d\n" as *const str as *const i8, 1i8);
+}