blob: 471be2baf234a5294d93901689683263da7fecaf [file] [log] [blame]
Fariborz Jahanian88b95212012-12-18 23:02:59 +00001// RUN: rm -rf %t
2// RUN: mkdir %t
Fariborz Jahanian88b95212012-12-18 23:02:59 +00003// 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
5
6/**
7 * \brief Aaa.
8*/
9int global_function();
10// CHECK: <Declaration>int global_function()</Declaration>
11
12/**
13 * \param x1 Aaa.
14*/
15extern void external_function(int x1);
16// CHECK: <Declaration>extern void external_function(int x1)</Declaration>
17
18/**
19 * \brief global variable;
20*/
21int global_variable;
22// CHECK: <Declaration>int global_variable</Declaration>
23
24/**
25 * \brief local variable;
26*/
27static int static_variable;
28// CHECK: <Declaration>static int static_variable</Declaration>
29
30/**
31 * \brief external variable
32*/
33extern int external_variable;
34// CHECK: <Declaration>extern int external_variable</Declaration>
35
36int global_function() {
37 /**
38 * \brief a local variable
39 */
40 int local = 10;
41 return local;
42}
43// CHECK: <Declaration>int global_function()</Declaration>
44// CHECK: <Declaration>int local = 10</Declaration>
45
46/**
47 * \brief initialized decl.
48*/
49int initialized_global = 100;
50// CHECK: <Declaration>int initialized_global = 100</Declaration>
51
52/**
53 * \brief typedef example
54*/
55typedef int INT_T;
56// CHECK: <Declaration>typedef int INT_T</Declaration>
57
58/**
59 * \brief aggregate type example
60*/
61struct S {
62/**
63 * \brief iS1;
64*/
65 int iS1;
66/**
67 * \brief dS1;
68*/
69 double dS1;
70};
Manuel Klimek36fab8d2013-01-10 13:24:24 +000071// CHECK: <Declaration>struct S {}</Declaration>
Fariborz Jahanian88b95212012-12-18 23:02:59 +000072// CHECK: <Declaration>int iS1</Declaration>
73// CHECK: <Declaration>double dS1</Declaration>
74
75/**
76 * \brief enum e;
77*/
78enum e {
79 One,
80/**
81 * \brief Two;
82*/
83 Two,
84 Three
85};
Manuel Klimek2f1ac412013-01-21 16:42:44 +000086// CHECK: <Declaration>enum e {}</Declaration>
Fariborz Jahanian88b95212012-12-18 23:02:59 +000087// CHECK: <Declaration>Two</Declaration>
88
89/**
90 *\brief block declaration
91*/
92int (^Block) (int i, int j);
Daniel Jasper46ef8522013-01-10 13:08:12 +000093// CHECK: <Declaration>int (^Block)(int, int)</Declaration>
Fariborz Jahanian88b95212012-12-18 23:02:59 +000094
95/**
96 *\brief block declaration
97*/
98int (^Block1) (int i, int j) = ^(int i, int j) { return i + j; };
Manuel Klimek36fab8d2013-01-10 13:24:24 +000099// CHECK: <Declaration>int (^Block1)(int, int) = ^(int i, int j) {}</Declaration>