summaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc.dg/property
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/objc.dg/property')
-rw-r--r--gcc/testsuite/objc.dg/property/dotsyntax-22.m19
-rw-r--r--gcc/testsuite/objc.dg/property/property.exp5
2 files changed, 22 insertions, 2 deletions
diff --git a/gcc/testsuite/objc.dg/property/dotsyntax-22.m b/gcc/testsuite/objc.dg/property/dotsyntax-22.m
new file mode 100644
index 00000000000..cc583482263
--- /dev/null
+++ b/gcc/testsuite/objc.dg/property/dotsyntax-22.m
@@ -0,0 +1,19 @@
+/* PR objc/47784. This testcase used to crash the compiler. */
+
+typedef struct {
+ float x;
+} SomeType;
+
+@interface MyClass
+
+@property(assign,readwrite) SomeType position;
+
+@end
+
+void example (MyClass *x)
+{
+ const SomeType SomeTypeZero = {0.0f};
+
+ x.position= SomeTypeZero;
+}
+
diff --git a/gcc/testsuite/objc.dg/property/property.exp b/gcc/testsuite/objc.dg/property/property.exp
index 350c4b8339f..e8773018841 100644
--- a/gcc/testsuite/objc.dg/property/property.exp
+++ b/gcc/testsuite/objc.dg/property/property.exp
@@ -33,8 +33,9 @@ set tests [lsort [glob -nocomplain $srcdir/$subdir/*.m]]
# Main loop.
dg-runtest $tests "-fgnu-runtime" $DEFAULT_CFLAGS
-# darwin targets can also run code with the NeXT runtime.
-if [istarget "*-*-darwin*" ] {
+# Darwin targets can also run code with the NeXT runtime.
+# but Properties are not supported by the runtime lib before Darwin 9.
+if [istarget "*-*-darwin\[9123\]*" ] {
dg-runtest $tests "-fnext-runtime" $DEFAULT_CFLAGS
}