Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Index / comment-cplus-template-decls.cpp
blobb3a8f40a4a413482289e209548c53fa76070a2ee
1 // RUN: rm -rf %t
2 // RUN: mkdir %t
3 // RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -target x86_64-apple-darwin10 std=c++11 %s > %t/out
4 // RUN: FileCheck %s < %t/out
6 // Ensure that XML we generate is not invalid.
7 // RUN: FileCheck %s -check-prefix=WRONG < %t/out
8 // WRONG-NOT: CommentXMLInvalid
10 /**
11 * \brief Aaa
13 template<typename T> struct A {
14 /**
15 * \brief Bbb
17 A();
18 /**
19 * \brief Ccc
21 ~A();
22 /**
23 * \brief Ddd
25 void f() { }
27 // CHECK: <Declaration>template &lt;typename T&gt; struct A {}</Declaration>
28 // CHECK: <Declaration>A&lt;T&gt;()</Declaration>
29 // CHECK: <Declaration>~A&lt;T&gt;()</Declaration>
31 /**
32 * \Brief Eee
34 template <typename T> struct D : A<T> {
35 /**
36 * \brief
38 using A<T>::f;
40 void f();
42 // CHECK: <Declaration>template &lt;typename T&gt; struct D : A&lt;T&gt; {}</Declaration>
43 // CHECK: <Declaration>using A&lt;T&gt;::f</Declaration>
45 struct Base {
46 int foo;
48 /**
49 * \brief
51 template<typename T> struct E : Base {
52 /**
53 * \brief
55 using Base::foo;
57 // CHECK: <Declaration>template &lt;typename T&gt; struct E : Base {}</Declaration>
58 // CHECK: <Declaration>using Base::foo</Declaration>
60 /// \tparam
61 /// \param AAA Blah blah
62 template<typename T>
63 void func_template_1(T AAA);
64 // CHECK: <Declaration>template &lt;typename T&gt; void func_template_1(T AAA)</Declaration>
66 template<template<template<typename CCC> class DDD, class BBB> class AAA>
67 void func_template_2();
68 // FIXME: There is not Declaration field in the generated output.
70 namespace rdar16128173 {
71 // CHECK: <Declaration>template &lt;class PtrTy&gt; class OpaquePtr {}</Declaration>
73 /// \brief Wrapper for void* pointer.
74 /// \tparam PtrTy Either a pointer type like 'T*' or a type that behaves like
75 /// a pointer.
76 template <class PtrTy>
77 class OpaquePtr {};
79 // CHECK: <Declaration>typedef OpaquePtr&lt;int&gt; DeclGroupPtrTy</Declaration>
80 typedef OpaquePtr<int> DeclGroupPtrTy;
82 DeclGroupPtrTy blah;