1/* Test for graceful encoding of const-qualified fields and parameters.  */
2/* Author: Ziemowit Laski  <zlaski@apple.com>  */
3
4/* { dg-do compile } */
5/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
6// { dg-additional-options "-Wno-objc-root-class" }
7
8struct Cxx {
9  const struct Cxx *next;
10};
11
12@interface ObjC {
13  const struct Cxx *obj;
14}
15- (ObjC *)initWithCxx: (struct Cxx *const)c and: (const struct Cxx *)d;
16@end
17
18@implementation ObjC
19- (ObjC *)initWithCxx: (struct Cxx *const)c and: (const struct Cxx *)d {
20  obj = d;
21  return self;
22}
23@end
24
25/* { dg-final { scan-assembler "@\[0-9\]+@0:\[0-9\]+r\\^{Cxx=\\^r{Cxx}}\[0-9\]+\\^r{Cxx}" } } */
26