1 // Run lines are sensitive to line numbers and come below the code.
2 // FIXME: re-enable this when we can serialize more C++ ASTs
3 class Cls {
4 public:
5 Cls operator +(const Cls &RHS);
6 };
7
bar()8 static void bar() {
9 Cls x1, x2, x3;
10 Cls x4 = x1 + x2 + x3;
11 }
12
operator +(const Cls & RHS)13 Cls Cls::operator +(const Cls &RHS) { while (1) {} }
14
15 // RUN: %clang_cc1 -emit-pch %s -o %t.ast
16
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 &&
21
22 // Yep, we can show references of '+' plus signs that are overloaded, w00t!
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 &&
27
28 // RUNx: index-test %t.ast -point-at %s:10:14 | grep 'DeclRefExpr x1'
29