summaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc.dg/invalid-method-1.m
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/objc.dg/invalid-method-1.m')
-rw-r--r--gcc/testsuite/objc.dg/invalid-method-1.m11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/invalid-method-1.m b/gcc/testsuite/objc.dg/invalid-method-1.m
new file mode 100644
index 00000000000..78eae2c5815
--- /dev/null
+++ b/gcc/testsuite/objc.dg/invalid-method-1.m
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* Test that we keep compiling if a method definition is found outside
+ of an @implementation context.
+*/
+
++ (void)C { } /* { dg-error "method definition not in @implementation context" } */
+
+/* We have another error here to test that the compiler is still going and
+ finding errors in the rest of the code.
+*/
+@compatibility_alias class1 class2; /* { dg-warning "annot find class" } */