[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Index / format-comment-cdecls.c
blob34cedfdb16b3068a9c20f11a4964ce6ef0a835bf
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 %s \
4 // RUN: | FileCheck %s
6 /**
7 * \brief Aaa.
8 */
9 int global_function();
10 // CHECK: <Declaration>int global_function()</Declaration>
12 /**
13 * \param x1 Aaa.
15 extern void external_function(int x1);
16 // CHECK: <Declaration>extern void external_function(int x1)</Declaration>
18 /**
19 * \brief global variable;
21 int global_variable;
22 // CHECK: <Declaration>int global_variable</Declaration>
24 /**
25 * \brief local variable;
27 static int static_variable;
28 // CHECK: <Declaration>static int static_variable</Declaration>
30 /**
31 * \brief external variable
33 extern int external_variable;
34 // CHECK: <Declaration>extern int external_variable</Declaration>
36 int global_function() {
37 /**
38 * \brief a local variable
40 int local = 10;
41 return local;
43 // CHECK: <Declaration>int global_function()</Declaration>
44 // CHECK: <Declaration>int local = 10</Declaration>
46 /**
47 * \brief initialized decl.
49 int initialized_global = 100;
50 // CHECK: <Declaration>int initialized_global = 100</Declaration>
52 /**
53 * \brief typedef example
55 typedef int INT_T;
56 // CHECK: <Declaration>typedef int INT_T</Declaration>
58 /**
59 * \brief aggregate type example
61 struct S {
62 /**
63 * \brief iS1;
65 int iS1;
66 /**
67 * \brief dS1;
69 double dS1;
71 // CHECK: <Declaration>struct S {}</Declaration>
72 // CHECK: <Declaration>int iS1</Declaration>
73 // CHECK: <Declaration>double dS1</Declaration>
75 /**
76 * \brief enum e;
78 enum e {
79 One,
80 /**
81 * \brief Two;
83 Two,
84 Three
86 // CHECK: <Declaration>enum e {}</Declaration>
87 // CHECK: <Declaration>Two</Declaration>
89 /**
90 *\brief block declaration
92 int (^Block) (int i, int j);
93 // CHECK: <Declaration>int (^Block)(int, int)</Declaration>
95 /**
96 *\brief block declaration
98 int (^Block1) (int i, int j) = ^(int i, int j) { return i + j; };
99 // CHECK: <Declaration>int (^Block1)(int, int) = ^(int i, int j) {\n}</Declaration>