brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · b3a8f40 Raw
84 lines · cpp
1// RUN: rm -rf %t2// RUN: mkdir %t3// 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/out4// RUN: FileCheck %s < %t/out5 6// Ensure that XML we generate is not invalid.7// RUN: FileCheck %s -check-prefix=WRONG < %t/out8// WRONG-NOT: CommentXMLInvalid9 10/**11 * \brief Aaa12*/13template<typename T> struct A {14/**15 * \brief Bbb16*/17  A();18/**19 * \brief Ccc20*/21  ~A();22/**23 * \brief Ddd24*/25  void f() { }26};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>30 31/**32 * \Brief Eee33*/34template <typename T> struct D : A<T> {35/**36 * \brief37*/38  using A<T>::f;39  40  void f();41};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>44 45struct Base {46    int foo;47};48/**49 * \brief50*/51template<typename T> struct E : Base {52/**53 * \brief54*/55  using Base::foo;56};57// CHECK: <Declaration>template &lt;typename T&gt; struct E :  Base {}</Declaration>58// CHECK: <Declaration>using Base::foo</Declaration>59 60/// \tparam61/// \param AAA Blah blah62template<typename T>63void func_template_1(T AAA);64// CHECK: <Declaration>template &lt;typename T&gt; void func_template_1(T AAA)</Declaration>65 66template<template<template<typename CCC> class DDD, class BBB> class AAA>67void func_template_2();68// FIXME: There is not Declaration field in the generated output.69 70namespace rdar16128173 {71// CHECK: <Declaration>template &lt;class PtrTy&gt; class OpaquePtr {}</Declaration>72 73/// \brief Wrapper for void* pointer.74/// \tparam PtrTy Either a pointer type like 'T*' or a type that behaves like75///               a pointer.76template <class PtrTy>77class OpaquePtr {};78 79// CHECK: <Declaration>typedef OpaquePtr&lt;int&gt; DeclGroupPtrTy</Declaration>80typedef OpaquePtr<int> DeclGroupPtrTy;81 82DeclGroupPtrTy blah;83}84