diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:06:01 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:06:01 +0000 |
| commit | 486754660bb926339aefcf012a3f848592babb8b (patch) | |
| tree | ecdbc446c9876f4f120f701c243373cd3cb43db3 /test/Index/Core | |
| parent | 55e6d896ad333f07bb3b1ba487df214fc268a4ab (diff) | |
Notes
Diffstat (limited to 'test/Index/Core')
| -rw-r--r-- | test/Index/Core/index-macros.c | 12 | ||||
| -rw-r--r-- | test/Index/Core/index-pch.cpp | 17 |
2 files changed, 29 insertions, 0 deletions
diff --git a/test/Index/Core/index-macros.c b/test/Index/Core/index-macros.c new file mode 100644 index 000000000000..61e7e7617544 --- /dev/null +++ b/test/Index/Core/index-macros.c @@ -0,0 +1,12 @@ +// RUN: c-index-test core -print-source-symbols -- %s | FileCheck %s + +// CHECK: [[@LINE+1]]:9 | macro/C | X1 | c:index-macros.c@157@macro@X1 | Def | +#define X1 1 +// CHECK: [[@LINE+1]]:9 | macro/C | DEF | c:index-macros.c@251@macro@DEF | Def | +#define DEF(x) int x +// CHECK: [[@LINE+1]]:8 | macro/C | X1 | c:index-macros.c@157@macro@X1 | Undef | +#undef X1 + +// CHECK: [[@LINE+2]]:1 | macro/C | DEF | c:index-macros.c@251@macro@DEF | Ref | +// CHECK: [[@LINE+1]]:5 | variable/C | i | c:@i | {{.*}} | Def | rel: 0 +DEF(i); diff --git a/test/Index/Core/index-pch.cpp b/test/Index/Core/index-pch.cpp new file mode 100644 index 000000000000..8c5a92b612c4 --- /dev/null +++ b/test/Index/Core/index-pch.cpp @@ -0,0 +1,17 @@ +// RUN: c-index-test core -print-source-symbols -- %s -std=c++14 | FileCheck %s +// RUN: %clang_cc1 -emit-pch %s -std=c++14 -o %t.pch +// RUN: c-index-test core -print-source-symbols -module-file %t.pch | FileCheck %s + +// CHECK: [[@LINE+2]]:8 | struct(Gen)/C++ | DETECTOR | [[DETECTOR_USR:.*]] | {{.*}} | Def | rel: 0 +template <class _Default, class _AlwaysVoid, template <class...> class _Op, class... _Args> +struct DETECTOR { + using value_t = int; +}; + +struct nonesuch {}; + +// CHECK: [[@LINE+4]]:9 | type-alias/C++ | is_detected +// CHECK: [[@LINE+3]]:32 | struct(Gen)/C++ | DETECTOR | [[DETECTOR_USR]] | {{.*}} | Ref,RelCont | rel: 1 +// CHECK-NEXT: RelCont | is_detected +template <template<class...> class _Op, class... _Args> + using is_detected = typename DETECTOR<nonesuch, void, _Op, _Args...>::value_t; |
