blob: 864744859332d5449157af8c165aafbe9aacf581 [file] [log] [blame]
Argyrios Kyrtzidis5d51ae22009-07-15 18:59:40 +00001// Run lines are sensitive to line numbers and come below the code.
Douglas Gregor39da0b82009-09-09 23:08:42 +00002// FIXME: re-enable this when we can serialize more C++ ASTs
Argyrios Kyrtzidis58f6eaf2009-07-14 05:34:59 +00003class Cls {
4public:
5 Cls operator +(const Cls &RHS);
6};
7
8static void bar() {
9 Cls x1, x2, x3;
10 Cls x4 = x1 + x2 + x3;
11}
12
Mike Stumpd46aa502009-07-21 21:06:08 +000013Cls Cls::operator +(const Cls &RHS) { while (1) {} }
Argyrios Kyrtzidis58f6eaf2009-07-14 05:34:59 +000014
Daniel Dunbara5728872009-12-15 20:14:24 +000015// RUN: %clang_cc1 -emit-pch %s -o %t.ast
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +000016
Douglas Gregor39da0b82009-09-09 23:08:42 +000017// 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 Kyrtzidisba4b8bd2009-07-14 03:19:46 +000021
22// Yep, we can show references of '+' plus signs that are overloaded, w00t!
Douglas Gregor39da0b82009-09-09 23:08:42 +000023// 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 Kyrtzidis8c4dc1f2009-07-31 19:02:11 +000027
Douglas Gregor39da0b82009-09-09 23:08:42 +000028// RUNx: index-test %t.ast -point-at %s:10:14 | grep 'DeclRefExpr x1'