Fariborz Jahanian | 88b9521 | 2012-12-18 23:02:59 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
| 2 | // RUN: mkdir %t |
Fariborz Jahanian | 88b9521 | 2012-12-18 23:02:59 +0000 | [diff] [blame] | 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 |
| 5 | |
| 6 | /** |
| 7 | * \brief Aaa. |
| 8 | */ |
| 9 | int global_function(); |
| 10 | // CHECK: <Declaration>int global_function()</Declaration> |
| 11 | |
| 12 | /** |
| 13 | * \param x1 Aaa. |
| 14 | */ |
| 15 | extern void external_function(int x1); |
| 16 | // CHECK: <Declaration>extern void external_function(int x1)</Declaration> |
| 17 | |
| 18 | /** |
| 19 | * \brief global variable; |
| 20 | */ |
| 21 | int global_variable; |
| 22 | // CHECK: <Declaration>int global_variable</Declaration> |
| 23 | |
| 24 | /** |
| 25 | * \brief local variable; |
| 26 | */ |
| 27 | static int static_variable; |
| 28 | // CHECK: <Declaration>static int static_variable</Declaration> |
| 29 | |
| 30 | /** |
| 31 | * \brief external variable |
| 32 | */ |
| 33 | extern int external_variable; |
| 34 | // CHECK: <Declaration>extern int external_variable</Declaration> |
| 35 | |
| 36 | int 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 | */ |
| 49 | int initialized_global = 100; |
| 50 | // CHECK: <Declaration>int initialized_global = 100</Declaration> |
| 51 | |
| 52 | /** |
| 53 | * \brief typedef example |
| 54 | */ |
| 55 | typedef int INT_T; |
| 56 | // CHECK: <Declaration>typedef int INT_T</Declaration> |
| 57 | |
| 58 | /** |
| 59 | * \brief aggregate type example |
| 60 | */ |
| 61 | struct S { |
| 62 | /** |
| 63 | * \brief iS1; |
| 64 | */ |
| 65 | int iS1; |
| 66 | /** |
| 67 | * \brief dS1; |
| 68 | */ |
| 69 | double dS1; |
| 70 | }; |
Manuel Klimek | 36fab8d | 2013-01-10 13:24:24 +0000 | [diff] [blame] | 71 | // CHECK: <Declaration>struct S {}</Declaration> |
Fariborz Jahanian | 88b9521 | 2012-12-18 23:02:59 +0000 | [diff] [blame] | 72 | // CHECK: <Declaration>int iS1</Declaration> |
| 73 | // CHECK: <Declaration>double dS1</Declaration> |
| 74 | |
| 75 | /** |
| 76 | * \brief enum e; |
| 77 | */ |
| 78 | enum e { |
| 79 | One, |
| 80 | /** |
| 81 | * \brief Two; |
| 82 | */ |
| 83 | Two, |
| 84 | Three |
| 85 | }; |
Manuel Klimek | 2f1ac41 | 2013-01-21 16:42:44 +0000 | [diff] [blame] | 86 | // CHECK: <Declaration>enum e {}</Declaration> |
Fariborz Jahanian | 88b9521 | 2012-12-18 23:02:59 +0000 | [diff] [blame] | 87 | // CHECK: <Declaration>Two</Declaration> |
| 88 | |
| 89 | /** |
| 90 | *\brief block declaration |
| 91 | */ |
| 92 | int (^Block) (int i, int j); |
Daniel Jasper | 46ef852 | 2013-01-10 13:08:12 +0000 | [diff] [blame] | 93 | // CHECK: <Declaration>int (^Block)(int, int)</Declaration> |
Fariborz Jahanian | 88b9521 | 2012-12-18 23:02:59 +0000 | [diff] [blame] | 94 | |
| 95 | /** |
| 96 | *\brief block declaration |
| 97 | */ |
| 98 | int (^Block1) (int i, int j) = ^(int i, int j) { return i + j; }; |
Manuel Klimek | 36fab8d | 2013-01-10 13:24:24 +0000 | [diff] [blame] | 99 | // CHECK: <Declaration>int (^Block1)(int, int) = ^(int i, int j) {}</Declaration> |