• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin10 %s -o - | FileCheck %s
2// rdar://problem/13359718
3// Substitute the actual type for a method returning instancetype.
4@interface NSObject
5+ (id)alloc;
6- (id)init;
7- (id)retain;
8@end
9
10@interface Foo : NSObject
11+ (instancetype)defaultFoo;
12@end
13
14@implementation Foo
15+(instancetype)defaultFoo {return 0;}
16// CHECK: ![[FOO:[0-9]+]] = metadata {{.*}}; [ DW_TAG_structure_type ] [Foo]
17// CHECK: metadata !"+[Foo defaultFoo]", metadata !"", i32 [[@LINE-2]], metadata ![[TYPE:[0-9]+]]
18// CHECK: ![[TYPE]] = {{.*}} metadata ![[RESULT:[0-9]+]], i32 {{.*}}, i32 {{.*}}} ; [ DW_TAG_subroutine_type ]
19// CHECK: ![[RESULT]] = metadata {{.*}}{metadata ![[FOOPTR:[0-9]+]],
20// CHECK: ![[FOOPTR]] = {{.*}}, metadata ![[FOO]]}{{.*}}[ DW_TAG_pointer_type ] {{.*}} [from Foo]
21@end
22
23
24int main (int argc, const char *argv[])
25{
26  Foo *foo = [Foo defaultFoo];
27  return 0;
28}
29