summaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc.dg/property/synthesize-5.m
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/objc.dg/property/synthesize-5.m')
-rw-r--r--gcc/testsuite/objc.dg/property/synthesize-5.m18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/property/synthesize-5.m b/gcc/testsuite/objc.dg/property/synthesize-5.m
new file mode 100644
index 000000000..0871b63ee
--- /dev/null
+++ b/gcc/testsuite/objc.dg/property/synthesize-5.m
@@ -0,0 +1,18 @@
+/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
+/* { dg-do compile } */
+
+/* Test that @synthesize does not ICE if asked to use a non-existing
+ ivar. */
+
+#include <objc/objc.h>
+
+@interface Test
+@property int v1;
+@end
+
+@implementation Test
+@synthesize v1; /* { dg-error "must be an existing ivar" } */
+@end
+/* { dg-warning "incomplete implementation" "" { target *-*-* } 15 } */
+/* { dg-warning "method definition for .-setV1:. not found" "" { target *-*-* } 15 } */
+/* { dg-warning "method definition for .-v1. not found" "" { target *-*-* } 15 } */