blob: 143b0673c8912c81255f2cc298a6a701dd572fb2 [file] [log] [blame]
Ted Kremeneke542f772010-04-20 23:15:40 +00001// RUN: c-index-test -test-load-source-usrs all %s | FileCheck %s
2
Ted Kremenekcf999102010-04-29 17:43:29 +00003static inline int my_helper(int x, int y) { return x + y; }
4
Ted Kremeneke542f772010-04-20 23:15:40 +00005enum {
6 ABA,
7 CADABA
8};
9
10enum {
11 FOO,
12 BAR
13};
14
15typedef struct {
16 int wa;
17 int moo;
18} MyStruct;
19
20enum Pizza {
21 CHEESE,
22 MUSHROOMS
23};
24
25@interface Foo {
26 id x;
27 id y;
28}
29- (id) godzilla;
30+ (id) kingkong;
31@property int d1;
32@end
33
34@implementation Foo
35- (id) godzilla {
36 static int a = 0;
37 extern int z;
38 return 0;
39}
40+ (id) kingkong {
Ted Kremenekcf999102010-04-29 17:43:29 +000041 int local_var;
Ted Kremeneke542f772010-04-20 23:15:40 +000042 return 0;
43}
44@synthesize d1;
45@end
46
47int z;
48
Ted Kremenekcf999102010-04-29 17:43:29 +000049static int local_func(int x) { return x; }
50
Ted Kremenek448278a2010-06-23 18:10:30 +000051@interface CWithExt
52@end
53@interface CWithExt ()
54@end
55@interface CWithExt ()
56@end
57@implementation CWithExt
58@end
59
Ted Kremenekf48b5312010-07-22 11:14:15 +000060// CHECK: usrs.m c:usrs.m@85@F@my_helper Extent=[3:19 - 3:60]
61// CHECK: usrs.m c:usrs.m@95@F@my_helper@x Extent=[3:29 - 3:34]
62// CHECK: usrs.m c:usrs.m@102@F@my_helper@y Extent=[3:36 - 3:41]
63// CHECK: usrs.m c:usrs.m@128@Ea Extent=[5:1 - 8:2]
64// CHECK: usrs.m c:usrs.m@128@Ea@ABA Extent=[6:3 - 6:6]
65// CHECK: usrs.m c:usrs.m@128@Ea@CADABA Extent=[7:3 - 7:9]
66// CHECK: usrs.m c:usrs.m@155@Ea Extent=[10:1 - 13:2]
67// CHECK: usrs.m c:usrs.m@155@Ea@FOO Extent=[11:3 - 11:6]
68// CHECK: usrs.m c:usrs.m@155@Ea@BAR Extent=[12:3 - 12:6]
Ted Kremenekcf999102010-04-29 17:43:29 +000069// CHECK: usrs.m c:@SA@MyStruct Extent=[15:9 - 18:2]
70// CHECK: usrs.m c:@SA@MyStruct@FI@wa Extent=[16:7 - 16:9]
71// CHECK: usrs.m c:@SA@MyStruct@FI@moo Extent=[17:7 - 17:10]
Ted Kremenekf48b5312010-07-22 11:14:15 +000072// CHECK: usrs.m c:usrs.m@219@T@MyStruct Extent=[18:3 - 18:11]
Ted Kremenekcf999102010-04-29 17:43:29 +000073// CHECK: usrs.m c:@E@Pizza Extent=[20:1 - 23:2]
74// CHECK: usrs.m c:@E@Pizza@CHEESE Extent=[21:3 - 21:9]
75// CHECK: usrs.m c:@E@Pizza@MUSHROOMS Extent=[22:3 - 22:12]
76// CHECK: usrs.m c:objc(cs)Foo Extent=[25:1 - 32:5]
77// CHECK: usrs.m c:objc(cs)Foo@x Extent=[26:6 - 26:7]
78// CHECK: usrs.m c:objc(cs)Foo@y Extent=[27:6 - 27:7]
79// CHECK: usrs.m c:objc(cs)Foo(py)d1 Extent=[31:15 - 31:17]
80// CHECK: usrs.m c:objc(cs)Foo(im)godzilla Extent=[29:1 - 29:17]
81// CHECK: usrs.m c:objc(cs)Foo(cm)kingkong Extent=[30:1 - 30:17]
82// CHECK: usrs.m c:objc(cs)Foo(im)d1 Extent=[31:15 - 31:17]
83// CHECK: usrs.m c:objc(cs)Foo(im)setD1: Extent=[31:15 - 31:17]
Ted Kremenekf48b5312010-07-22 11:14:15 +000084// CHECK: usrs.m c:usrs.m@352objc(cs)Foo(im)setD1:@d1 Extent=[31:15 - 31:17]
Ted Kremenekcf999102010-04-29 17:43:29 +000085// CHECK: usrs.m c:objc(cs)Foo Extent=[34:1 - 45:2]
86// CHECK: usrs.m c:objc(cs)Foo(im)godzilla Extent=[35:1 - 39:2]
Ted Kremenekf48b5312010-07-22 11:14:15 +000087// CHECK: usrs.m c:usrs.m@409objc(cs)Foo(im)godzilla@a Extent=[36:10 - 36:19]
Ted Kremenekcbd66f02010-05-06 23:38:28 +000088// CHECK: usrs.m c:objc(cs)Foo(im)godzilla@z Extent=[37:10 - 37:15]
Ted Kremenekcf999102010-04-29 17:43:29 +000089// CHECK: usrs.m c:objc(cs)Foo(cm)kingkong Extent=[40:1 - 43:2]
Ted Kremenekf48b5312010-07-22 11:14:15 +000090// CHECK: usrs.m c:usrs.m@470objc(cs)Foo(cm)kingkong@local_var Extent=[41:3 - 41:16]
Ted Kremenekcf999102010-04-29 17:43:29 +000091// CHECK: usrs.m c:objc(cs)Foo@d1 Extent=[44:13 - 44:15]
92// CHECK: usrs.m c:objc(cs)Foo(py)d1 Extent=[44:1 - 44:15]
93// CHECK: usrs.m c:@z Extent=[47:1 - 47:6]
Ted Kremenekf48b5312010-07-22 11:14:15 +000094// CHECK: usrs.m c:usrs.m@540@F@local_func Extent=[49:12 - 49:43]
95// CHECK: usrs.m c:usrs.m@551@F@local_func@x Extent=[49:23 - 49:28]
Ted Kremenek448278a2010-06-23 18:10:30 +000096// CHECK: usrs.m c:objc(cs)CWithExt Extent=[51:1 - 52:5]
97// CHECK: usrs.m c:objc(cy)CWithExt@ Extent=[53:1 - 54:5]
98// CHECK: usrs.m c:objc(cy)CWithExt@ Extent=[55:1 - 56:5]
99// CHECK: usrs.m c:objc(cs)CWithExt Extent=[57:1 - 58:2]
100
Ted Kremeneke542f772010-04-20 23:15:40 +0000101
Ted Kremenekf48b5312010-07-22 11:14:15 +0000102