Argyrios Kyrtzidis | 5d51ae2 | 2009-07-15 18:59:40 +0000 | [diff] [blame] | 1 | // Run lines are sensitive to line numbers and come below the code. |
Douglas Gregor | 39da0b8 | 2009-09-09 23:08:42 +0000 | [diff] [blame] | 2 | // FIXME: re-enable this when we can serialize more C++ ASTs |
Argyrios Kyrtzidis | 58f6eaf | 2009-07-14 05:34:59 +0000 | [diff] [blame] | 3 | class Cls { |
| 4 | public: |
| 5 | Cls operator +(const Cls &RHS); |
| 6 | }; |
| 7 | |
| 8 | static void bar() { |
| 9 | Cls x1, x2, x3; |
| 10 | Cls x4 = x1 + x2 + x3; |
| 11 | } |
| 12 | |
Mike Stump | d46aa50 | 2009-07-21 21:06:08 +0000 | [diff] [blame] | 13 | Cls Cls::operator +(const Cls &RHS) { while (1) {} } |
Argyrios Kyrtzidis | 58f6eaf | 2009-07-14 05:34:59 +0000 | [diff] [blame] | 14 | |
Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 15 | // RUN: %clang_cc1 -emit-pch %s -o %t.ast |
Argyrios Kyrtzidis | 3e8efd9 | 2009-07-21 00:06:46 +0000 | [diff] [blame] | 16 | |
Douglas Gregor | 39da0b8 | 2009-09-09 23:08:42 +0000 | [diff] [blame] | 17 | // RUNx: index-test %t.ast -point-at %s:10:17 -print-decls > %t && |
| 18 | // RUNx: cat %t | count 2 && |
| 19 | // RUNx: grep ':5:9,' %t && |
| 20 | // RUNx: grep ':13:10,' %t && |
Argyrios Kyrtzidis | ba4b8bd | 2009-07-14 03:19:46 +0000 | [diff] [blame] | 21 | |
| 22 | // Yep, we can show references of '+' plus signs that are overloaded, w00t! |
Douglas Gregor | 39da0b8 | 2009-09-09 23:08:42 +0000 | [diff] [blame] | 23 | // RUNx: index-test %t.ast -point-at %s:5:15 -print-refs > %t && |
| 24 | // RUNx: cat %t | count 2 && |
| 25 | // RUNx: grep ':10:17,' %t && |
| 26 | // RUNx: grep ':10:22,' %t && |
Argyrios Kyrtzidis | 8c4dc1f | 2009-07-31 19:02:11 +0000 | [diff] [blame] | 27 | |
Douglas Gregor | 39da0b8 | 2009-09-09 23:08:42 +0000 | [diff] [blame] | 28 | // RUNx: index-test %t.ast -point-at %s:10:14 | grep 'DeclRefExpr x1' |