Ted Kremenek | e542f77 | 2010-04-20 23:15:40 +0000 | [diff] [blame] | 1 | // RUN: c-index-test -test-load-source-usrs all %s | FileCheck %s |
| 2 | |
Ted Kremenek | cf99910 | 2010-04-29 17:43:29 +0000 | [diff] [blame] | 3 | static inline int my_helper(int x, int y) { return x + y; } |
| 4 | |
Ted Kremenek | e542f77 | 2010-04-20 23:15:40 +0000 | [diff] [blame] | 5 | enum { |
| 6 | ABA, |
| 7 | CADABA |
| 8 | }; |
| 9 | |
| 10 | enum { |
| 11 | FOO, |
| 12 | BAR |
| 13 | }; |
| 14 | |
| 15 | typedef struct { |
| 16 | int wa; |
| 17 | int moo; |
| 18 | } MyStruct; |
| 19 | |
| 20 | enum 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 Kremenek | cf99910 | 2010-04-29 17:43:29 +0000 | [diff] [blame] | 41 | int local_var; |
Ted Kremenek | e542f77 | 2010-04-20 23:15:40 +0000 | [diff] [blame] | 42 | return 0; |
| 43 | } |
| 44 | @synthesize d1; |
| 45 | @end |
| 46 | |
| 47 | int z; |
| 48 | |
Ted Kremenek | cf99910 | 2010-04-29 17:43:29 +0000 | [diff] [blame] | 49 | static int local_func(int x) { return x; } |
| 50 | |
Ted Kremenek | 448278a | 2010-06-23 18:10:30 +0000 | [diff] [blame] | 51 | @interface CWithExt |
| 52 | @end |
| 53 | @interface CWithExt () |
| 54 | @end |
| 55 | @interface CWithExt () |
| 56 | @end |
| 57 | @implementation CWithExt |
| 58 | @end |
| 59 | |
Ted Kremenek | f48b531 | 2010-07-22 11:14:15 +0000 | [diff] [blame] | 60 | // 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 Kremenek | cf99910 | 2010-04-29 17:43:29 +0000 | [diff] [blame] | 69 | // 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 Kremenek | f48b531 | 2010-07-22 11:14:15 +0000 | [diff] [blame] | 72 | // CHECK: usrs.m c:usrs.m@219@T@MyStruct Extent=[18:3 - 18:11] |
Ted Kremenek | cf99910 | 2010-04-29 17:43:29 +0000 | [diff] [blame] | 73 | // 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 Kremenek | f48b531 | 2010-07-22 11:14:15 +0000 | [diff] [blame] | 84 | // CHECK: usrs.m c:usrs.m@352objc(cs)Foo(im)setD1:@d1 Extent=[31:15 - 31:17] |
Ted Kremenek | cf99910 | 2010-04-29 17:43:29 +0000 | [diff] [blame] | 85 | // 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 Kremenek | f48b531 | 2010-07-22 11:14:15 +0000 | [diff] [blame] | 87 | // CHECK: usrs.m c:usrs.m@409objc(cs)Foo(im)godzilla@a Extent=[36:10 - 36:19] |
Ted Kremenek | cbd66f0 | 2010-05-06 23:38:28 +0000 | [diff] [blame] | 88 | // CHECK: usrs.m c:objc(cs)Foo(im)godzilla@z Extent=[37:10 - 37:15] |
Ted Kremenek | cf99910 | 2010-04-29 17:43:29 +0000 | [diff] [blame] | 89 | // CHECK: usrs.m c:objc(cs)Foo(cm)kingkong Extent=[40:1 - 43:2] |
Ted Kremenek | f48b531 | 2010-07-22 11:14:15 +0000 | [diff] [blame] | 90 | // CHECK: usrs.m c:usrs.m@470objc(cs)Foo(cm)kingkong@local_var Extent=[41:3 - 41:16] |
Ted Kremenek | cf99910 | 2010-04-29 17:43:29 +0000 | [diff] [blame] | 91 | // 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 Kremenek | f48b531 | 2010-07-22 11:14:15 +0000 | [diff] [blame] | 94 | // 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 Kremenek | 448278a | 2010-06-23 18:10:30 +0000 | [diff] [blame] | 96 | // 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 Kremenek | e542f77 | 2010-04-20 23:15:40 +0000 | [diff] [blame] | 101 | |
Ted Kremenek | f48b531 | 2010-07-22 11:14:15 +0000 | [diff] [blame] | 102 | |