]> git.ipfire.org Git - people/ms/gcc.git/commitdiff
testsuite: Add test with missing semicolon
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Mon, 27 Feb 2023 13:08:10 +0000 (14:08 +0100)
committerCohenArthur <arthur.cohen@embecosm.com>
Tue, 28 Feb 2023 17:00:02 +0000 (17:00 +0000)
Add a test to the testsuite in order to verify the presence of a
semicolon at the end of an external type item declaration.

gcc/testsuite/ChangeLog:

* rust/compile/extern_type_item_missing_semi.rs: New failing
test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/testsuite/rust/compile/extern_type_item_missing_semi.rs [new file with mode: 0644]

diff --git a/gcc/testsuite/rust/compile/extern_type_item_missing_semi.rs b/gcc/testsuite/rust/compile/extern_type_item_missing_semi.rs
new file mode 100644 (file)
index 0000000..a42af02
--- /dev/null
@@ -0,0 +1,7 @@
+// { dg-additional-options "-fsyntax-only" }
+
+extern "C" {
+    type F;
+    type E // { dg-error "failed to parse" }
+} // { dg-error "expecting" }
+// { dg-error "failed to parse item in crate" ""  { target *-*-* } .-1 }