annotate clang/test/Index/c-index-getCursor-pp.c @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 #define OBSCURE(X) X
anatofuz
parents:
diff changeset
2 #define DECORATION
anatofuz
parents:
diff changeset
3 #define FNM(X) OBSCURE(X)
anatofuz
parents:
diff changeset
4 typedef int T;
anatofuz
parents:
diff changeset
5 void OBSCURE(func)(int x) {
anatofuz
parents:
diff changeset
6 OBSCURE(T) DECORATION value;
anatofuz
parents:
diff changeset
7 }
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 #include "a.h"
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 #define A(X) X
anatofuz
parents:
diff changeset
12 #define B(X) A(X)
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 B(int x);
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 const char *fname = __FILE__;
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 #include <a.h>
anatofuz
parents:
diff changeset
19
anatofuz
parents:
diff changeset
20 #ifdef OBSCURE
anatofuz
parents:
diff changeset
21 #endif
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 #if defined(OBSCURE)
anatofuz
parents:
diff changeset
24 #endif
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 #define C(A) A
anatofuz
parents:
diff changeset
27
anatofuz
parents:
diff changeset
28 // RUN: c-index-test -cursor-at=%s:1:11 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-1 %s
anatofuz
parents:
diff changeset
29 // CHECK-1: macro definition=OBSCURE
anatofuz
parents:
diff changeset
30 // RUN: c-index-test -cursor-at=%s:2:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-2 %s
anatofuz
parents:
diff changeset
31 // CHECK-2: macro definition=DECORATION
anatofuz
parents:
diff changeset
32 // RUN: c-index-test -cursor-at=%s:5:7 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-3 %s
anatofuz
parents:
diff changeset
33 // CHECK-3: macro expansion=OBSCURE:1:9
anatofuz
parents:
diff changeset
34 // RUN: c-index-test -cursor-at=%s:6:6 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-4 %s
anatofuz
parents:
diff changeset
35 // CHECK-4: macro expansion=OBSCURE:1:9
anatofuz
parents:
diff changeset
36 // RUN: c-index-test -cursor-at=%s:6:19 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-5 %s
anatofuz
parents:
diff changeset
37 // CHECK-5: macro expansion=DECORATION:2:9
anatofuz
parents:
diff changeset
38 // RUN: c-index-test -cursor-at=%s:9:10 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-6 %s
anatofuz
parents:
diff changeset
39 // CHECK-6: inclusion directive=a.h
anatofuz
parents:
diff changeset
40 // RUN: c-index-test -cursor-at=%s:14:1 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-7 %s
anatofuz
parents:
diff changeset
41 // CHECK-7: macro expansion=B:12:9
anatofuz
parents:
diff changeset
42 // RUN: c-index-test -cursor-at=%s:16:25 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-8 %s
anatofuz
parents:
diff changeset
43 // CHECK-8: macro expansion=__FILE__
anatofuz
parents:
diff changeset
44 // RUN: c-index-test -cursor-at=%s:18:12 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-9 %s
anatofuz
parents:
diff changeset
45 // CHECK-9: inclusion directive=a.h
anatofuz
parents:
diff changeset
46 // RUN: c-index-test -cursor-at=%s:20:10 -cursor-at=%s:23:15 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-10 %s
anatofuz
parents:
diff changeset
47 // CHECK-10: 20:8 macro expansion=OBSCURE
anatofuz
parents:
diff changeset
48 // CHECK-10: 23:13 macro expansion=OBSCURE
anatofuz
parents:
diff changeset
49
anatofuz
parents:
diff changeset
50 // RUN: c-index-test -cursor-at=%s:3:20 -cursor-at=%s:12:14 \
anatofuz
parents:
diff changeset
51 // RUN: -cursor-at=%s:26:11 -cursor-at=%s:26:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-IN-MACRODEF %s
anatofuz
parents:
diff changeset
52 // CHECK-IN-MACRODEF: 3:16 macro expansion=OBSCURE
anatofuz
parents:
diff changeset
53 // CHECK-IN-MACRODEF: 12:14 macro expansion=A
anatofuz
parents:
diff changeset
54 // CHECK-IN-MACRODEF: 26:9 macro definition=C
anatofuz
parents:
diff changeset
55 // CHECK-IN-MACRODEF: 26:9 macro definition=C
anatofuz
parents:
diff changeset
56
anatofuz
parents:
diff changeset
57 // Same tests, but with "editing" optimizations
anatofuz
parents:
diff changeset
58 // RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:1:11 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-1 %s
anatofuz
parents:
diff changeset
59 // RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:2:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-2 %s
anatofuz
parents:
diff changeset
60 // RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:5:7 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-3 %s
anatofuz
parents:
diff changeset
61 // RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:9:10 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-6 %s
anatofuz
parents:
diff changeset
62 // RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:3:20 -cursor-at=%s:12:14 \
anatofuz
parents:
diff changeset
63 // RUN: -cursor-at=%s:26:11 -cursor-at=%s:26:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-IN-MACRODEF %s