1//===-- main.c --------------------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#import <Foundation/Foundation.h>
10
11@interface MyClass : NSObject {
12};
13-(void)test;
14@end
15
16@implementation MyClass
17-(void)test {
18    printf("%p\n", self); // break here
19}
20@end
21
22@interface MyOwner : NSObject {
23  @public id ownedThing; // should be id, to test <rdar://problem/31363513>
24};
25@end
26
27@implementation MyOwner
28@end
29
30int main (int argc, char const *argv[]) {
31    @autoreleasepool {
32        MyOwner *owner = [[MyOwner alloc] init];
33        owner->ownedThing = [[MyClass alloc] init];
34        [(MyClass*)owner->ownedThing test];
35    }
36    return 0;
37}
38
39