aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc.dg/encode-6.m
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/objc.dg/encode-6.m')
-rw-r--r--gcc/testsuite/objc.dg/encode-6.m23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/encode-6.m b/gcc/testsuite/objc.dg/encode-6.m
new file mode 100644
index 00000000000..d23dc6cf399
--- /dev/null
+++ b/gcc/testsuite/objc.dg/encode-6.m
@@ -0,0 +1,23 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Test for graceful encoding of const-qualified fields and parameters. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile } */
+
+struct Cxx {
+ const struct Cxx *next;
+};
+
+@interface ObjC {
+ const struct Cxx *obj;
+}
+- (ObjC *)initWithCxx: (struct Cxx *const)c and: (const struct Cxx *)d;
+@end
+
+@implementation ObjC
+- (ObjC *)initWithCxx: (struct Cxx *const)c and: (const struct Cxx *)d {
+ obj = d;
+ return self;
+}
+@end
+
+/* { dg-final { scan-assembler "@\[0-9\]+@0:\[0-9\]+r\\^{Cxx=\\^r{Cxx}}\[0-9\]+\\^r{Cxx}" } } */