Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / Index / Core / index-macros.c
blob2e487db4f2673bb1f2e3c6902dd1cd72a730c8d2
1 // RUN: c-index-test core -print-source-symbols -- %s | FileCheck %s
2 // RUN: c-index-test core -print-source-symbols -ignore-macros -- %s | FileCheck %s -check-prefix=DISABLED
3 // DISABLED-NOT: macro/C
4 // DISABLED-NOT: XI
6 // CHECK: [[@LINE+1]]:9 | macro/C | X1 | [[X1_USR:.*@macro@X1]] | Def |
7 #define X1 1
8 // CHECK: [[@LINE+1]]:9 | macro/C | DEF | [[DEF_USR:.*@macro@DEF]] | Def |
9 #define DEF(x) int x
10 // CHECK: [[@LINE+1]]:8 | macro/C | X1 | [[X1_USR]] | Undef |
11 #undef X1
13 // CHECK: [[@LINE+1]]:9 | macro/C | C | [[C_USR:.*@macro@C]] | Def |
14 #define C 1
15 // CHECK: [[@LINE+1]]:5 | macro/C | C | [[C_USR]] | Ref |
16 #if C
17 #endif
18 // CHECK: [[@LINE+1]]:8 | macro/C | C | [[C_USR]] | Ref |
19 #ifdef C
20 #endif
21 // CHECK: [[@LINE+1]]:9 | macro/C | C | [[C_USR]] | Ref |
22 #ifndef C
23 #endif
24 // CHECK: [[@LINE+1]]:13 | macro/C | C | [[C_USR]] | Ref |
25 #if defined(C)
26 #endif
27 // CHECK: [[@LINE+1]]:14 | macro/C | C | [[C_USR]] | Ref |
28 #if !defined(C)
29 #endif
31 // Nonexistent macros should not be included.
32 // CHECK-NOT: NOT_DEFINED
33 #ifdef NOT_DEFINED
34 #endif
35 #ifndef NOT_DEFINED
36 #endif
37 #if defined(NOT_DEFINED) && NOT_DEFINED
38 #elif !defined(NOT_DEFINED)
39 #endif
41 // CHECK: [[@LINE+1]]:5 | macro/C | __LINE__ | c:@macro@__LINE__ | Ref |
42 #if __LINE__ == 41
43 #endif
45 // CHECK: [[@LINE+2]]:1 | macro/C | DEF | [[DEF_USR]] | Ref |
46 // CHECK: [[@LINE+1]]:5 | variable/C | i | c:@i | {{.*}} | Def | rel: 0
47 DEF(i);