Douglas Gregor | 09d9fa1 | 2010-04-05 16:10:30 +0000 | [diff] [blame] | 1 | // Note: the run lines follow their respective tests, since line/column |
| 2 | // matter in this test. |
| 3 | |
| 4 | #define FOO(Arg1,Arg2) foobar |
Douglas Gregor | 590c7d5 | 2010-07-08 20:55:51 +0000 | [diff] [blame] | 5 | #define nil 0 |
Douglas Gregor | 09d9fa1 | 2010-04-05 16:10:30 +0000 | [diff] [blame] | 6 | void f() { |
| 7 | |
| 8 | } |
| 9 | |
Douglas Gregor | 590c7d5 | 2010-07-08 20:55:51 +0000 | [diff] [blame] | 10 | void g(int); |
| 11 | |
| 12 | void f2() { |
| 13 | int *ip = nil; |
| 14 | ip = nil; |
| 15 | g(nil); |
| 16 | } |
| 17 | |
Douglas Gregor | e424470 | 2011-07-30 08:17:44 +0000 | [diff] [blame^] | 18 | #define variadic1(...) |
| 19 | #define variadic2(args...) |
| 20 | #define variadic3(args, ...) |
| 21 | #define variadic4(first, second, args, ...) |
| 22 | |
| 23 | void test_variadic() { |
| 24 | |
| 25 | } |
| 26 | |
Douglas Gregor | 09d9fa1 | 2010-04-05 16:10:30 +0000 | [diff] [blame] | 27 | // RUN: c-index-test -code-completion-at=%s:7:1 %s | FileCheck -check-prefix=CHECK-CC1 %s |
Douglas Gregor | 87c08a5 | 2010-08-13 22:48:40 +0000 | [diff] [blame] | 28 | // RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:7:1 %s | FileCheck -check-prefix=CHECK-CC1 %s |
Douglas Gregor | 09d9fa1 | 2010-04-05 16:10:30 +0000 | [diff] [blame] | 29 | // CHECK-CC1: macro definition:{TypedText FOO}{LeftParen (}{Placeholder Arg1}{Comma , }{Placeholder Arg2}{RightParen )} |
Douglas Gregor | 590c7d5 | 2010-07-08 20:55:51 +0000 | [diff] [blame] | 30 | // RUN: c-index-test -code-completion-at=%s:13:13 %s | FileCheck -check-prefix=CHECK-CC2 %s |
| 31 | // RUN: c-index-test -code-completion-at=%s:14:8 %s | FileCheck -check-prefix=CHECK-CC2 %s |
Douglas Gregor | 1827e10 | 2010-08-16 16:18:59 +0000 | [diff] [blame] | 32 | // RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:14:8 %s | FileCheck -check-prefix=CHECK-CC2 %s |
Douglas Gregor | d754d55 | 2010-09-16 16:21:35 +0000 | [diff] [blame] | 33 | // CHECK-CC2: macro definition:{TypedText nil} (32) |
Douglas Gregor | 590c7d5 | 2010-07-08 20:55:51 +0000 | [diff] [blame] | 34 | // RUN: c-index-test -code-completion-at=%s:15:5 %s | FileCheck -check-prefix=CHECK-CC3 %s |
Douglas Gregor | 1827e10 | 2010-08-16 16:18:59 +0000 | [diff] [blame] | 35 | // RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:15:5 %s | FileCheck -check-prefix=CHECK-CC3 %s |
Douglas Gregor | d754d55 | 2010-09-16 16:21:35 +0000 | [diff] [blame] | 36 | // CHECK-CC3: macro definition:{TypedText nil} (65) |
Douglas Gregor | e424470 | 2011-07-30 08:17:44 +0000 | [diff] [blame^] | 37 | // RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:24:2 %s | FileCheck -check-prefix=CHECK-VARIADIC %s |
| 38 | // CHECK-VARIADIC: macro definition:{TypedText variadic1}{LeftParen (}{Placeholder ...}{RightParen )} (70) |
| 39 | // CHECK-VARIADIC: macro definition:{TypedText variadic2}{LeftParen (}{Placeholder args...}{RightParen )} (70) |
| 40 | // CHECK-VARIADIC: macro definition:{TypedText variadic3}{LeftParen (}{Placeholder args, ...}{RightParen )} (70) |
| 41 | // CHECK-VARIADIC: macro definition:{TypedText variadic4}{LeftParen (}{Placeholder first}{Comma , }{Placeholder second...}{Placeholder first, second...}{RightParen )} (70) |