aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/obj-c++.dg/encode-1-next.mm
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/obj-c++.dg/encode-1-next.mm')
-rw-r--r--gcc-4.9/gcc/testsuite/obj-c++.dg/encode-1-next.mm26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/obj-c++.dg/encode-1-next.mm b/gcc-4.9/gcc/testsuite/obj-c++.dg/encode-1-next.mm
new file mode 100644
index 000000000..47673f20c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/obj-c++.dg/encode-1-next.mm
@@ -0,0 +1,26 @@
+/* This file tests that things are encoded using the gcc-3.3 ABI which is only
+ used by the NeXT runtime. */
+/* Test for graceful encoding of const-qualified fields and parameters. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+
+/* { dg-do compile } */
+/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
+
+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\]+\\^{Cxx=\\^{Cxx}}\[0-9\]+r\\^{Cxx=\\^{Cxx}}" } } */