view gcc/testsuite/objc.dg/encode-6.m @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* Test for graceful encoding of const-qualified fields and parameters.  */
/* Author: Ziemowit Laski  <zlaski@apple.com>  */
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-fnext-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\]+r\\^{Cxx=\\^r{Cxx}}\[0-9\]+\\^r{Cxx}" } } */