[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / CodeGenObjC / debug-info-instancetype.m
blobbe454e38c0b3bca4cc98b30a92d4cf7bf7ae725f
1 // RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -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
10 @interface Foo : NSObject
11 + (instancetype)defaultFoo;
12 @end
14 @implementation Foo
15 +(instancetype)defaultFoo {return 0;}
16 // CHECK: ![[FOO:[0-9]+]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Foo"
17 // CHECK: !DISubprogram(name: "+[Foo defaultFoo]"
18 // CHECK-SAME:          line: [[@LINE-3]]
19 // CHECK-SAME:          type: ![[TYPE:[0-9]+]]
20 // CHECK: ![[TYPE]] = !DISubroutineType(types: ![[RESULT:[0-9]+]])
21 // CHECK: ![[RESULT]] = !{![[FOOPTR:[0-9]+]],
22 // CHECK: ![[FOOPTR]] = !DIDerivedType(tag: DW_TAG_pointer_type
23 // CHECK-SAME:                         baseType: ![[FOO]]
24 @end
27 int main (int argc, const char *argv[])
29   Foo *foo = [Foo defaultFoo];
30   return 0;